;==============================================================
; CNS File for Vegeta Z2 by Balthazar & Cybaster
; Majin Vegeta Z2 by XGargoyle
; Helper States
;==============================================================



;======================================================================
; POWER CHARGE AURA

[Statedef 905]
type = A
movetype = I
physics = N
ctrl = 0
anim = IfElse((root,var(1)=1),905,907)
velset = 0,0
sprpriority = -1


[State 905, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = NoShadow

[State 905, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 905, BindToParent]
type = BindToParent
trigger1 = anim = 905 || anim = 907
pos = IfElse((root,var(1)=1),-10,3),-2

[State 905, BindToParent] ;RAGE Majin
type = BindToParent
trigger1 = root,stateno = 910
pos = -12,-2

[State 905, Anim]
type = ChangeAnim
triggerall = anim = 905 || anim = 907
trigger1 = root,stateno = 901 || root,stateno = 911
value = IfElse((root,var(1)=1),906,9071)

[State 905, DestroySelf]
type = DestroySelf
trigger1 = (anim = 905 || anim = 907) && (Root,StateNo != [900,910])
trigger2 = (anim = 906 || anim = 9071) && animtime = 0
trigger3 = Root,stateno = [5000,5090]



;======================================================================
;LAND FX

[Statedef 17100]
type=A
movetype=I
physics=N
anim=15999
sprpriority=1
velset=0,0

[state 17100,bind]
type = bindtoparent
trigger1 = !time
pos = -11,0

[state 17100, Landing Effect]
type=explod
trigger1=!time
anim=17100
id=17100
pos=0,0
postype=P1
sprpriority=-3
ownpal=1
supermovetime=-1

[state 17100]
type=removeexplod
trigger1=time>10

[State 17100]
type=destroyself
trigger1=time>10


;======================================================================
; Repel helper : 1305
; Destroyed : 1306
; Reflect with random projectile : 1308
; Reflected projectile : 1315
; Reflected projectile explods : 1316
;======================================================================

; REPEL HELPER FOR SLASH CHOP

[Statedef 1305]
type = S
physics = N
movetype = A
ctrl = 0
sprpriority = 4

[State 1305, nothitby]
type = nothitby
trigger1 = 1
time = -1
value = SCA
ignorehitpause = 1

[State 1305, HB]
type = hitby
trigger1 = 1
time = 1
value = SCA, NP, SP, HP
ignorehitpause = 1

[State 1305, HitOverride]
type = hitoverride
trigger1 = 1
time = -1
attr = SCA, AA, AP, AT
stateno = 1306
ignorehitpause = 1

[State 1305, HitOverride]
type = hitoverride
trigger1 = 1
time = -1
attr = SCA, NP, SP,HP
stateno = 1308
ignorehitpause = 1

[State 1305, Anim]
type = changeanim
trigger1 = anim != 1305
value = 1305

[State 1305, timevar]
type = varadd
trigger1 = 1
var(4) = 1

[State 1305, Shadows]
type = afterimage
trigger1 = !time && !prevstateno
time = 999
timegap = 1
framegap = 4
length = 12
palcontrast = 30, 60, 120
trans = add

[State 1305, Type]
type = statetypeset
trigger1 = movecontact
movetype = I

[State 1305, End]
type = changestate
trigger1 = var(4) >= 13
value = 1306

;-----------------------------------------
; Destroyed
[Statedef 1306]
type = A
physics = N
movetype = I
velset = 0, 0
ctrl = 0
sprpriority = 1
anim = 15998

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

[State 1306, End]
type = destroyself
trigger1 = !animtime

;-----------------------------------------
; Reflect with projectile
[Statedef 1308]
type = A
physics = N
movetype = I
ctrl = 0
anim = 15998

[State 1308, nothitby]
type = nothitby
trigger1 = 1
time = 1
value = SCA
ignorehitpause = 1

[State 1308, reflected]
type = helper
trigger1 = !time
helpertype = normal
stateno = 1315
ID = 1315
name = "Reflected"
postype = p1
pos = 25, -20
ownpal = 1
size.xscale = 1
size.yscale = 1

[State 1308, End]
type = changestate
trigger1 = 1
value = 1306   ;1305

;-----------------------------------------
; Reflected projectile Kamehameha
[Statedef 1315]
type=S
physics=N
movetype=A
ctrl=0
velset=0,0
sprpriority=4
poweradd = 100

[State 200, Ki goes SFX]
type = PlaySnd
trigger1 = !time
value = 10,0
channel = 1

[State -2, Explod];P1 Side.
type = Explod
trigger1 = !time && numexplod(13300)=0 && teamside = 1
anim = 13300
pos = 10,80
postype = left  ;p2,front,back,left,right
removetime = -2
supermove = 1
;scale = 0.5,0.5
sprpriority = 0
id = 13300
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = -1
persistent = 0

[State -2, Explod];P2 Side.
type = Explod
trigger1 = !time && numexplod(13300)=0 && teamside = 2
anim = 13301
pos = -169,80 ;-95,80
postype = right ;left
removetime = -2
supermove = 1
;scale = 0.5,0.5
sprpriority = 0
id = 13300
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = -1
persistent = 0

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 1061, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 1315, HitOverride]
type=hitoverride
trigger1= 1
time=-1
attr=SCA,AA,AP,AT
stateno=1316
ignorehitpause=1

[State 1315, HB]
type=hitby
trigger1= 1
time=-1
value=SCA,NP,SP,HP
ignorehitpause=1

[state 1315]
type = varset
triggerall = numenemy
triggerall = enemy,authorname = "Team Z2"
trigger1 = enemy,name = "Goku Z2"
trigger2 = enemy,name = "SSJ Goku Z2"
trigger3 = enemy,name = "Vegeta Z2"
trigger4 = enemy,name = "Gohan Z2"
var(11) = 1

[State 1315, Anim];normal kamehameha FX (yellow/blue)
type=changeanim
trigger1= !time && !prevstateno && var(11)=0 && root,var(44)=0
value=1311
[State 1315, Anim];normal kamehameha FX (old purple)
type=changeanim
trigger1= !time && !prevstateno && var(11)=0 && root,var(44)>=1
value=1310
[State 1315, Anim];Vegeta kamehameha FX
type=changeanim
trigger1= !time && !prevstateno && var(11)=1
value=1010

[State 1315, Vel]
type=velset
trigger1= 1
x = 8

[State 1315, image]
type=afterimage
trigger1= !time && !prevstateno
time=999
timegap=1
framegap=2
length=5
palcontrast=50,50,200
trans=add

[State 1315, Hit]
type=hitdef
trigger1= 1
priority=4,Hit
attr = S,SP
;damage = ceil(61*root,fvar(12)), ceil(6*root,fvar(12))
damage = ceil(ifElse((root,fvar(11)) * 61 < 7, 7, (root,fvar(11)) * 61)), 6
animtype = Hard
hitflag = MAF
guardflag=MA
pausetime=0,10
sparkno = -1
guard.sparkno = -1
sparkxy = -10,0
hitsound  = S1000,0
guardsound = S6,1
ground.type=High
ground.slidetime=16
ground.hittime=16
ground.velocity=-10,0
ground.cornerpush.veloff=0
air.velocity=-4,-2
getpower= ifelse(p2movetype=H,40,140), 35
givepower = 35,35
envshake.time=14
envshake.freq=120
envshake.ampl=4
air.fall=1
fall.recover=1
fall.recovertime=16
yaccel=.5
airguard.ctrltime= 16
airguard.velocity= -8, -1.5
forcestand=1
p1sprpriority = 5

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[State 1315, Sparks]
type=explod
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
anim=7020
sprpriority=3
postype=p2
pos=(target,const(size.ground.front)-10),-floor(p2dist y)
removetime=-2
ownpal=1
facing=-1
ignorehitpause=1
persistent=0
pausemovetime=100
supermovetime=100

[State 1315, End]
type=changestate
trigger1= movecontact
value=1316
ignorehitpause=1

[State 1315, End]
type=destroyself
trigger1=pos x!=[-200,200]

;-----------------------------------------
; Kamehameha explod/vanish
[Statedef 1316]
type=A
physics=N
movetype=I
velset=0,0
ctrl=0
sprpriority=4

[State 1308, nothitby]
type = nothitby
trigger1 = 1
time = 1
value = SCA
ignorehitpause = 1

[State 3005, anim];VS Z2 chars
type = changeanim
trigger1 = !time && var(11)=1
value = 1013
[State 3005, anim];Repel (old)
type = changeanim
trigger1 = !time && var(11)=0 && prevstateno=1315 && root,var(44)>=1
value = 1316
[State 3005, anim];Repel (yellow/blue)
type = changeanim
trigger1 = !time && var(11)=0 && prevstateno=1315 && root,var(44)=0
value = 1311

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 1061, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 1316, End]
type=destroyself
trigger1= !animtime

;==========================================================
; SUPER BG - Street Fighter 3

[Statedef 19875]
type = S
velset = 0,0
sprpriority = 0
anim = 15999
ctrl = 0

[State 10500, snd]
type = playsnd
trigger1 = !time
value = 9,0

[State 10000, AssertSpecial]
type = AssertSpecial
trigger1 = time <= 55
flag = noFG

[State 10000, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nomusic

[State 10000, Explod]; White BG
type = Explod
trigger1 = time = 0
anim = 19877
id = 19875
pos =  160,120
postype = left
sprpriority = -7
facing = 1
bindtime = -1
ownpal = 1
removetime = 99999999999999
pausemovetime = 99999999999999
supermovetime = 99999999999999
supermove = 1
scale = 1.20,1.20
ignorehitpause = 1
persistent = 0

[State 10000, Explod SF3]
type = Explod
trigger1 = time = 0
anim = 19875
id = 10000
pos =  160,120
postype = left
sprpriority = -7
facing = 1
bindtime = -1
ownpal = 1
removetime = 9999999999999
pausemovetime = 99999999999999
supermovetime = 99999999999999
supermove = 1
scale = 1.20*0.9,1.20*1.05
ignorehitpause = 1
persistent = 0

[State 10000, pause]
type = Pause
trigger1 = Time = 0
time = 40
movetime = 40

[State 10000, RemoveExplod]
type = RemoveExplod
trigger1 = time = 44
id = 10000

[State 10000, RemoveExplod]
type = RemoveExplod
trigger1 = time = 55
id = 10500

[State 8020, End]
type = destroyself
trigger1 = !(roundstate>2)
trigger2 = time=1000

;==========================================================
; SUPER BG - Super DBZ (Physics)

[Statedef 19885]
type = S
velset = 0,0
sprpriority = 0
anim = 15999
ctrl = 0

[State 1000, shake]
type = EnvShake
trigger1 = !(time%4) && time<150
time=4
freq=80
ampl=7

[State 10500, snd]
type = playsnd
trigger1 = !time
value = 9,0

[State 10000, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noFG
flag2 = nokoslow
ignorehitpause = 1

[State 10000, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nomusic
flag2 = nobardisplay
ignorehitpause = 1

[State 10000, Explod]; White BG
type = Explod
trigger1 = time = 0
anim = 19884
id = 19884
pos =  160,120
postype = left
sprpriority = -4
facing = 1
bindtime = -1
ownpal = 1
pausemovetime = 99999999999999
supermovetime = 99999999999999
scale = 1.20,1.20
ignorehitpause = 1
persistent = 0
removetime = -2

[State 10000, Explod Krak]
type = Explod
trigger1 = time = 0
anim = 19885
id = 19885
pos =  160,120
postype = left
sprpriority = -7
facing = 1
bindtime = -1
ownpal = 1
removetime = 9999999999999
pausemovetime = 99999999999999
supermovetime = 99999999999999
supermove = 1
scale = 1,1
ignorehitpause = 1
persistent = 0

[State 10000, Scale Explod]
type = ModifyExplod
trigger1 = time>6
scale = 1+.01*time, 1+.01*time
id = 19885

[State 10000, RemoveExplod Krak]
type = RemoveExplod
trigger1 = time = 44
id = 19885

[State 10000, Explod Space BG]
type = Explod
trigger1 = time = 23
anim = 19886
id = 19886
pos =  160,120
postype = left
sprpriority = -7
facing = 1
bindtime = -1
ownpal = 1
removetime = 9999999999999
pausemovetime = 99999999999999
supermovetime = 99999999999999
scale = 1.3,1.3
ignorehitpause = 1
persistent = 0

[State 10000, Explod planet left]
type = Explod
trigger1 = time = 23
anim = 19887
id = 19886
pos =  0,240
postype = left
sprpriority = -6
facing = 1
ownpal = 1
removetime = 9999999999999
pausemovetime = 99999999999999
supermovetime = 99999999999999
scale = 1.2,1.2
ignorehitpause = 1
persistent = 0
;vel = -.2,0
bindtime = -1

[State 10000, Explod planet right]
type = Explod
trigger1 = time = 23
anim = 19888
id = 19886
pos =  320,240
postype = left
sprpriority = -6
facing = 1
ownpal = 1
removetime = 9999999999999
pausemovetime = 99999999999999
supermovetime = 99999999999999
scale = 1.2,1.2
ignorehitpause = 1
persistent = 0
;vel = .2,0
bindtime = -1

[State 1000, Helper]
type = Helper
trigger1 = time>=23 && time<70 && !(time%5) && numhelper(19890)<80 && numhelper(19891)<80
helpertype = Normal
name = "rocks"
id = 19890
pos = 160,20
postype = left
facing = 1
stateno = 19890
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999

[State 13300, black screen fade]
type = Explod
trigger1 = Time = 60
anim = 19883   ;2771
ID = 2771
postype = left
pos = 0,-50
bindtime = -1
removetime = 91
pausemovetime = 91
ontop = 1
scale = 2,3

[State 10000, RemoveExplod Krak]
type = RemoveExplod
trigger1 = time = 150
id = 19886

[State 8020, End]
type = destroyself
trigger1 = !(roundstate>2)
trigger2 = time=150  ;1000

;------------------------------------------------------
;Rocks going up

[Statedef 19890]
type = A
movetype = I
physics = N
anim = 15999

[State 1003, Helper]
type = Helper
trigger1 = !time
helpertype = Normal
name = "rocks"
id = 19891
pos = ((random%320)),10*(random%13)
postype = left
facing = 1
stateno = 19891
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1
size.xscale = .5
size.yscale = .5

[State 1003, Helper]
type = Helper
trigger1 = !time
helpertype = Normal
name = "rocks"
id = 19891
pos = ((random%320)+320),10*(random%13)
postype = left
facing = 1
stateno = 19891
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1
size.xscale = .5
size.yscale = .5

[State 1003, Helper]
type = Helper
trigger1 = !time
helpertype = Normal
name = "rocks"
id = 19891
pos = ((random%320)-320),10*(random%13)
postype = left
facing = 1
stateno = 19891
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1
size.xscale = .5
size.yscale = .5

[State 1003, DestroySelf]
type = DestroySelf
trigger1 = time=2

;-----------------
[Statedef 19891]
type = A
movetype = I
physics = N
anim = 19890 + random%6
sprpriority = -5

[State 1004, assert]
type = assertspecial
trigger1 = 1
flag = noshadow

[State 1004, vel]
type = velset
trigger1 = !time
y = -3-random%7

[State 1004, vel]
type = varset
trigger1 = !time
var(10) = random%2

[State 1004, assert]
type = angledraw
trigger1 = 1
value = ifelse(var(10)=0,5*time,-5*time)

[State 1004, DestroySelf]
type = DestroySelf
trigger1 = time > 300
trigger2 = pos Y < -340
trigger3 = root,stateno = 180

;==========================================================
; SUPER BG - Super DBZ (Ki attacks)

[Statedef 19892]
type = S
velset = 0,0
sprpriority = 0
anim = 15999
ctrl = 0

[State 3001, screen]
type = PosSet
trigger1 = !time
x = 0
y = -ceil(screenpos Y)
ignorehitpause = 1

[State 3001, screen]
type = PosSet
trigger1 = 1
x = 0
ignorehitpause = 1

[State 1000, shake]
type = EnvShake
trigger1 = !(time%4) && time<150
time=4
freq=80
ampl=7

[State 10500, snd]
type = playsnd
trigger1 = !time
value = 9,0

[State 10000, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noFG
flag2 = nokoslow
ignorehitpause = 1

[State 10000, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nomusic
flag2 = nobardisplay
ignorehitpause = 1

[State 10000, Explod]; White BG
type = Explod
trigger1 = !time
anim = 957
id = 11111
pos =  0,-30
postype = left
sprpriority = -7
facing = 1
bindtime = -1
ownpal = 1
removetime = -1
supermovetime = -1
pausemovetime = -1
ignorehitpause = 1
scale = 2,2

[State 10000, Explod Zwang]
type = Explod
trigger1 = time = 0
anim = 19896
id = 19896
pos =  160,120
postype = left
sprpriority = -5
facing = 1
bindtime = -1
ownpal = 1
removetime = 9999999999999
pausemovetime = 99999999999999
supermovetime = 99999999999999
ignorehitpause = 1
scale = .9,1.2

[State 10000, Scale Explod]
type = ModifyExplod
trigger1 = time>50
scale = .9+.005*(time-50), 1.2+.005*(time-50)
id = 19896

[State 1003, Helper]
type = Helper
trigger1 = !time
helpertype = Normal
name = "yellow_BG"
id = 19897
pos = 0,0
postype = left
facing = 1
stateno = 19897
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1
persistent = 0

[State 13300, white screen fade]
type = Explod
trigger1 = Time = 60
anim = 19883
ID = 2771
postype = left
pos = 0,-50
bindtime = -1
removetime = 91
pausemovetime = 91
ontop = 1
scale = 2,3
ignorehitpause = 1

[State 10000, RemoveExplod zwang]
type = RemoveExplod
trigger1 = time = 140
id = 19896
[State 10000, RemoveExplod yellow BG]
type = RemoveExplod
trigger1 = time = 140
id = 19897
[State 10000, RemoveExplod white BG]
type = RemoveExplod
trigger1 = time = 140
id = 11111

[State 10000, pause]
type = Pause
trigger1 = !time
time = 20
movetime = 20
ignorehitpause = 1

[State 8020, End]
type = destroyself
trigger1 = !(roundstate>2)
trigger2 = time=150

;--------------------------------------
;Yellow Super BG Helper
[Statedef 19897]
type = S
movetype = I
physics = N
anim = 19897
sprpriority = -6

[State 1004, assert]
type = bindtoparent
trigger1 = 1
pos = 0,120
ignorehitpause = 1

[State 1004, assert]
type = assertspecial
trigger1 = 1
flag = noshadow
flag2 = noFG
ignorehitpause = 1

[State 1004, assert]
type = angledraw
trigger1 = time < 50
value = 10*time
scale = .7,.7
ignorehitpause = 1

[State 1004, assert]
type = angledraw
trigger1 = time >= 50
value = 10*time
scale = .7+.01*(time-50),.7+.01*(time-50)
ignorehitpause = 1

[State 1004, DestroySelf]
type = DestroySelf
trigger1 = time > 130

;==========================================================
; SUPER BG - Jojo's Bizarre Adventure

[Statedef 19900]
type    = A
movetype= I
physics = N
ctrl = 0
anim = 15999
sprpriority = -21

[State 1211, Exclamation]
type = Explod
trigger1 = Time = 0
anim = 19910
id = 8001
pos = 0,-10
postype = back
sprpriority = -21
bindtime = -1
scale = 0.83333333333333333333333333333333,1.0810810810810810810810810810811
removetime = -1
supermovetime = -1
pausemovetime = -1
ignorehitpause = 1

[State 1211, Exclamation]
type = Explod
trigger1 = Time = 0
anim = 19911
id = 8001
pos = 0,-10
postype = back
sprpriority = -21
bindtime = -1
scale = 0.83333333333333333333333333333333,1.0810810810810810810810810810811
removetime = -1
supermovetime = -1
pausemovetime = -1
ignorehitpause = 1

[State 1211, Exclamation]
type = Explod
trigger1 = Time = 0
anim = 19912
id = 8001
pos = 0,-10
postype = back
sprpriority = -21
bindtime = -1
scale = 0.83333333333333333333333333333333,1.0810810810810810810810810810811
removetime = -1
supermovetime = -1
pausemovetime = -1
ignorehitpause = 1

[State 1211, Exclamation]
type = Explod
trigger1 = Time = 0
anim = 19913
id = 8001
pos = 0,-10
postype = back
sprpriority = -21
bindtime = -1
scale = 0.83333333333333333333333333333333,1.0810810810810810810810810810811
removetime = -1
supermovetime = -1
pausemovetime = -1
ignorehitpause = 1

[State 1211, Exclamation]
type = Explod
trigger1 = Time = 0
anim = 19900
id = 19900
pos = 0,0
postype = back
sprpriority = 5
bindtime = -1
scale = .84, 1.07
supermovetime = -1
pausemovetime = -1
ignorehitpause = 1
persistent = 0
ontop = 1

[State 10500, snd]
type = playsnd
trigger1 = !time
value = 9,0

[state haha]
type = varset
trigger1 = time = 0
var(3) = 0

[state haha]
type = varadd
trigger1 = time >= 5
trigger1 = var(3) < 220
var(3) = 5

[State that starts the inverted effect]
type           = PalFX
trigger1       = time >= 5
add            = var(3),var(3),var(3)
time           = 1
ignorehitpause = 1

[State 2030, 0]
type = AssertSpecial
Trigger1 = Time < ifelse(matchover, 120, 50)
flag = nofg
flag2 = nobardisplay
ignorehitpause = 1

[State haha]
type = RemoveExplod
trigger1 = Time = ifelse(matchover, 120, 50)
id = 8001

[State ChangeState!]
type = DestroySelf
trigger1 = RoundState = 0

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

[Statedef 13200]
type=A
physics=N
movetype=I
anim = 15999
velset=0,0
sprpriority=6

[State 8000, Assert]
type=assertspecial
trigger1= 1
flag=noshadow
ignorehitpause = 1

[State -2, Explod]; Notification
type = null ;Explod
trigger1 = !time
anim = 13200
removetime = -2
supermove = 1
sprpriority = 1
id = 13200
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = -1
facing = facing
scale = 0.5,0.5

[state 17100,scale FX]
type = null ;modifyexplod
trigger1 = numexplod(13200)
trigger1 = time>=10
scale = 0.5+0.02*(time-10),0.5+0.02*(time-10)
id = 13200

[State 8000, End]
type=destroyself
trigger1= time>=40

;===================================================
;BEAM COLLISION NOTIFICATION

[Statedef 13250]
type=A
physics=N
movetype=I
anim = 15999
velset=0,0
sprpriority=6

[State 8000, Assert]
type=assertspecial
trigger1= 1
flag=noshadow
ignorehitpause = 1

[State -2, Explod]; Notification
type = null ;Explod
trigger1 = !time
anim = 13250
removetime = -2
supermove = 1
sprpriority = 1
id = 13250
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = -1
pos = 160,120
postype = left
scale = 0.5,0.5

[state 17100,scale FX]
type = null ;modifyexplod
trigger1 = numexplod(13250)
trigger1 = time>=10
scale = 0.5+0.02*(time-10),0.5+0.02*(time-10)
id = 13250

[State 8000, End]
type=destroyself
trigger1= time>=40

;===================================================
[StateDef 2771] ; Fade in/out effects BLACK
type = A
movetype = I
physics = N
anim = 15999
velset = 0,0

[State 13300, Expl]
type = Explod
trigger1 = Time = 30
anim = 2771
ID = 2771
postype = left
pos = -30,-30
bindtime = -1
removetime = 71
pausemovetime = 71
ontop = 1
scale = 2,2

[State 13300, Fadeout]
type = PalFX
trigger1 = Time = [30,100]
time = 1
add = 4*(Time-30),4*(Time-30),4*(Time-30)

[State 13001, End]
type = DestroySelf
trigger1 = time=101

;===================================================
; Limit basics comboability
[Statedef 15999]
type    = S
movetype= A
physics = N
anim = 15999
sprpriority = -5

[State 2260, muteki]
type = NotHitBy
trigger1 = 1
value = SCA

[State 2260, destroy]
type = DestroySelf
trigger1 = numenemy
trigger1 = enemynear, movetype != H || (enemynear, stateno = [120,155]) || enemynear, ctrl
trigger2 = time = 24

;===================================================
;Pulse Effect during fall recovery (taken from Possessed Heita by The_None)

[Statedef 52100]
type    = S
movetype = I
physics = S
sprpriority = 4
anim = 15999
ctrl = 0

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

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,AA,AP,AT

[State 0, PosAdd]
type = PosAdd
trigger1 = 1
x = ifelse(root,stateno=5201,ceil(parentdist x/3.0),parentdist x)
y = parentdist y

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

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

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time
value = var(0)
elem = var(1)

[State 0, VarSet]
type = VarAdd
trigger1 = time
fvar(0) = 11.2

[State 0, VarSet]
type = VarAdd
trigger1 = time
fvar(1) = 0.015

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

[State 0, Trans]
type = Trans
trigger1 = 1
trans = add

[State 0, PalFX]
type = PalFX
trigger1 = 1
time = 1
add = floor(0-fvar(0)),floor(0-fvar(0)),floor(0-fvar(0))

[State 0, ]
type = DestroySelf
trigger1 = root,stateno != 5201
trigger1 = root,stateno != 5210

;---------------------------
;Detect life Helper (Coded by 2OS)

[Statedef 2]
ctrl = 0

[State 2OS]
type = statetypeset
trigger1 = 1
movetype = I
ignorehitpause = 1
persistent = 1

[State 2OS, Blank Animation]
type = changeanim
trigger1 = 1
value = 15999
ignorehitpause = 1
persistent = 1

[State 2OS]
type = bindtoroot
trigger1 = 1
pos = 0,0
ignorehitpause = 1
persistent = 1

[State 2OS, Damage Var Delay Reset]
type = varset
trigger1 = var(1)>1
var(1) = 0
ignorehitpause = 1
persistent = 1

[State 2OS, Damage Var Delay]
type = varadd
trigger1 = var(2) != root,life
var(1) = 1
ignorehitpause = 1
persistent = 1

[State 2OS, Damage Var]
type = varset
trigger1 = (var(1)!=[0,1])
var(2) = root,life
ignorehitpause = 1
persistent = 1

;==========================================================
; BAKUHATSUHA HELPER

[Statedef 2301]
type = A
physics = N
movetype = A
ctrl = 0
sprpriority = 5

[State 3005, anim]
type = changeanim
trigger1 = !time
value = 2301


[State 1061, transparency]
type = Trans
trigger1 = root,var(2)=1
trans = addalpha
alpha = 200,128

[State 1061, NoJuggle]
type = parentvarset
trigger1 = time = 0
var(18) = 1

[State 3005, hitvar]
type=varadd
trigger1= !time
var(2)=1

[State 1055, movehitvar]
type=varset
trigger1= movecontact && numtarget
trigger1= !(target,ishelper)
var(3)=1
ignorehitpause=1

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 17100, twirl FX]
type=explod
trigger1 = !time
anim=17200
id=17200
pos=7,0
postype=P1
sprpriority=-2
ownpal=1
supermovetime=-1
removetime = -2
persistent = 0
scale = 1,0.8

[State 3005, hit]
type = hitdef
trigger1 = !movecontact
attr = S,HP
hitflag = MAF
guardflag = MA
priority = 7,Hit
;damage = ceil(160*root,fvar(12)), 17
;damage = ceil(ifElse((root,fvar(11)) * 160 < 7, 7, (root,fvar(11)) * 160)), 17
damage = ceil(ifElse((root,fvar(11)) * 160 < 30, 30, (root,fvar(11)) * 160)), 17
getpower = 0,0
givepower = 35,35
pausetime = 4,6
animtype = Back
air.animtype = Back
fall.animtype = Back
ground.type = High
air.type = Low
ground.hittime = 16
ground.slidetime = 16
guard.hittime = 16
air.hittime = 13
airguard.ctrltime = 16
ground.velocity= -2,-10
guard.velocity = -9
air.velocity = -3,-8
airguard.velocity = -4, -4 
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
yaccel = .5
fall=1
air.fall = 1
fall.recover = 0
fall.recovertime = 13
sparkno = -1
hitsound   = s2301,0
guardsound = S6,1
envshake.time = 16
envshake.ampl = 6
envshake.freq = 100
forcestand = 1
;palfx.sinadd=64,64,64,4
;palfx.mul=128,128,128
;palfx.time=32
palfx.add = 255,50,0
palfx.sinadd = -255,-50,0,20
palfx.time = 60
p1sprpriority = 5

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = movecontact 
var(18) = 0

[State 1315, Sparks]
type=explod
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
anim=7020
sprpriority=7
postype=p2
pos=(target,const(size.ground.front)-10),-50;floor(p2dist y)
removetime=-2
ownpal=1
facing=-1
ignorehitpause=1
persistent=0
pausemovetime=100
supermovetime=100

[state -2, helper]
type = helper
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
pos = 0,0
postype = left
stateno = 8600
helpertype = normal
name = "Fire"
sprpriority = -5
ownpal = 1
ignorehitpause = 1

[State 3302, Helper Limiter]
type = Helper
triggerall = !NumHelper(9995)
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
helpertype = normal
name = "Limiter"
ID = 9995
stateno = 9999
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1

[State 3001, Guardshake]
type = envshake
trigger1 = movecontact=1 && numtarget
time = 4
ampl = 6
freq = 176
ignorehitpause = 1

[State 1061, End]
type = destroyself
trigger1 = !animtime

;==========================================================
; BAKUHATSUHA LV2 HELPER

[Statedef 2321]
type = A
physics = N
movetype = A
ctrl = 0
sprpriority = 5 + 2*ishelper(2322)

[State 3005, anim]
type = changeanim
trigger1 = !time
value = 2301

[State 1061, transparency]
type = Trans
trigger1 = root,var(2)=1
trans = addalpha
alpha = 200,128

[State 1061, NoJuggle]
type = parentvarset
trigger1 = time = 0
var(18) = 1

[State 3005, hitvar]
type=varadd
trigger1= !time
var(2)=1

[State 1055, movehitvar]
type=varset
trigger1= movecontact && numtarget
trigger1= !(target,ishelper)
var(3)=1
ignorehitpause=1

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 17100, twirl FX]
type=explod
trigger1 = !time
anim=17200
id=17200
pos=7,0
postype=P1
sprpriority=-2
ownpal=1
supermovetime=-1
removetime = -2
persistent = 0
scale = 1,0.8

[State 3005, hit]
type = hitdef
trigger1 = !movecontact
attr = S,HP
hitflag = MAF
guardflag = MA
priority = 7,Hit
;damage = ceil(130*root,fvar(12)), 15
;damage = ceil(ifElse((root,fvar(11)) * 130 < 7, 7, (root,fvar(11)) * 130)), 15
damage = ceil(ifElse((root,fvar(11)) * 130 < 40, 40, (root,fvar(11)) * 130)), 15
getpower = 0,0
givepower = 35,35
pausetime = 4,6
animtype = Back
air.animtype = Back
fall.animtype = Back
ground.type = High
air.type = Low
ground.hittime = 16
ground.slidetime = 16
guard.hittime = 16
air.hittime = 13
airguard.ctrltime = 16
ground.velocity= -2,-10
guard.velocity = -9
air.velocity = -3,-8
airguard.velocity = -4, -4 
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
yaccel = .5
fall=1
air.fall = 1
fall.recover = 0
fall.recovertime = 13
sparkno = -1
hitsound   = s2301,0
guardsound = S6,1
envshake.time = 16
envshake.ampl = 6
envshake.freq = 100
forcestand = 1
palfx.add = 255,50,0
palfx.sinadd = -255,-50,0,20
palfx.time = 60

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = movecontact 
var(18) = 0

[State 1315, Sparks]
type=explod
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
anim=7020
sprpriority=8
postype=p2
pos=(target,const(size.ground.front)-10),-50;floor(p2dist y)
removetime=-2
ownpal=1
facing=-1
ignorehitpause=1
persistent=0
pausemovetime=100
supermovetime=100

[state -2, helper]
type = helper
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
pos = 0,0
postype = left
stateno = 8600
helpertype = normal
name = "Fire"
sprpriority = -5
ownpal = 1
ignorehitpause = 1

[State 3001, Guardshake]
type = envshake
trigger1 = movecontact=1 && numtarget
time = 4
ampl = 6
freq = 176
ignorehitpause = 1

[State 1061, End]
type = destroyself
trigger1 = !animtime

;==========================================================
; BAKUHATSUHA LV3 HELPER

[Statedef 2341]
type = A
physics = N
movetype = A
ctrl = 0
sprpriority = 5 + ishelper(2342) + 2*ishelper(2343)

[State 3005, anim]
type = changeanim
trigger1 = !time
value = 2301

[State 1061, transparency]
type = Trans
trigger1 = root,var(2)=1
trans = addalpha
alpha = 200,128

[State 1061, NoJuggle]
type = parentvarset
trigger1 = time = 0
var(18) = 1

[State 3005, hitvar]
type=varadd
trigger1= !time
var(2)=1

[State 1055, movehitvar]
type=varset
trigger1= movecontact && numtarget
trigger1= !(target,ishelper)
var(3)=1
ignorehitpause=1

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 17100, twirl FX]
type=explod
trigger1 = !time
anim=17200
id=17200
pos=7,0
postype=P1
sprpriority=-2
ownpal=1
supermovetime=-1
removetime = -2
persistent = 0
scale = 1,0.8

[State 3005, hit]
type = hitdef
trigger1 = !movecontact
attr = S,HP
hitflag = MAF
guardflag = MA
priority = 7,Hit
;damage = ceil(115*root,fvar(12)), 13
;damage = ceil(ifElse((root,fvar(11)) * 115 < 7, 7, (root,fvar(11)) * 115)), 13
damage = ceil(ifElse((root,fvar(11)) * 115 < 50, 50, (root,fvar(11)) * 115)), 13
getpower = 0,0
givepower = 35,35
pausetime = 4,6
animtype = Back
air.animtype = Back
fall.animtype = Back
ground.type = High
air.type = Low
ground.hittime = 16
ground.slidetime = 16
guard.hittime = 16
air.hittime = 13
airguard.ctrltime = 16
ground.velocity= -3,-8
guard.velocity = -9
air.velocity = -5,-7
airguard.velocity = -4, -4 
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
yaccel = .5
fall=1
air.fall = 1
fall.recover = 0
fall.recovertime = 13
sparkno = -1
hitsound   = s2301,0
guardsound = S6,1
envshake.time = 16
envshake.ampl = 6
envshake.freq = 100
forcestand = 1
palfx.add = 255,50,0
palfx.sinadd = -255,-50,0,20
palfx.time = 60

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = movecontact 
var(18) = 0

[State 1315, Sparks]
type=explod
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
anim = 7020
sprpriority=8
postype=p2
pos=(target,const(size.ground.front)-10),-50
removetime=-2
ownpal=1
facing=-1
ignorehitpause=1
persistent=0
pausemovetime=100
supermovetime=100

[state -2, helper]
type = helper
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
pos = 0,0
postype = left
stateno = 8600
helpertype = normal
name = "Fire"
sprpriority = -5
ownpal = 1
ignorehitpause = 1

[State 3001, Guardshake]
type = envshake
trigger1 = movecontact=1 && numtarget
time = 4
ampl = 6
freq = 176
ignorehitpause = 1

[State 1061, End]
type = destroyself
trigger1 = !animtime

;========================================================
; MACHINE GUN TEMPER HELPER
; light = 1410
; Medium = 1411
; Strong = 1412
; Vanishes = 1030
;========================================================

;LIGHT VERSION HELPER
[Statedef 1410]
type    = S
movetype= A
physics = N
anim = 1010
sprpriority = 5
hitcountpersist = 1
movehitpersist = 1

[State 1061, gethit gut ?]
type = VarSet
trigger1 = !time
var(14) = root,var(14)

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 1061, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = time = 0
var(18) = 1

[State 1061, Velocity]
type = VelSet
trigger1 = Time = 0
x = 5

[State 1061, Velocity]
type = VelSet
trigger1 = Movehit
x = 0

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

[State 1061, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 1061, HitOverride]
type = HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 1030
attr = SCA, AA, AP, AT
ignorehitpause = 1

[State 1061, Hitdef]
type = HitDef
trigger1 = var(14)=0
attr = S, SP
animtype  = hard
;damage    = ceil(10*root,fvar(12)), ceil(2*root,fvar(12))
damage = ceil(ifElse((root,fvar(11)) * 10 < 9, 3, (root,fvar(11)) * 10)), 2
priority  = 4,Hit
guardflag = MA
hitflag = MAF
pausetime = 0,10
sparkno = s7010
guard.sparkno = -1
sparkxy = 0,0
hitsound   = s1000,0
guardsound = S6,1
ground.type = high
air.type = low
ground.slidetime = 20;15
ground.hittime  = 25;15
ground.velocity = -7.8,0
guard.velocity = -7.5
air.velocity = -5.8,-3
airguard.velocity = -5, -4
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
air.fall = 0
fall.recover = 1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = 0,0  ;ifelse(p2movetype=H,40,140), 10
givepower = 35,35

[State 1061, Hitdef]
type = HitDef
trigger1 = var(14)=1
attr = S, SP
animtype  = hard
;damage    = ceil(10*root,fvar(12)), ceil(2*root,fvar(12))
damage = ceil(ifElse((root,fvar(11)) * 10 < 9, 3, (root,fvar(11)) * 10)), 2
priority  = 4,Hit
guardflag = MA
hitflag = MAF
pausetime = 0,10
sparkno = s7010
guard.sparkno = -1
sparkxy = 0,0
hitsound   = s1000,0
guardsound = S6,1
ground.type = low
air.type = low
ground.slidetime = 20;15
ground.hittime  = 25;15
ground.velocity = -7.8,0
guard.velocity = -7.5
air.velocity = -5.8,-3
airguard.velocity = -5, -4
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
air.fall = 0
fall.recover = 1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = 0,0  ;ifelse(p2movetype=H,40,140), 10
givepower = 35,35

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[State 1410, Helper Limiter]
type = Helper
triggerall = !NumHelper(9997)
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
helpertype = normal
name =  "Limiter"
ID = 9997
stateno = 9999
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1

[state 1410, Flame overlay]
type = helper
triggerall = !NumHelper(9990)
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
trigger1 = target,IsHelper=0
pos = 0,0
postype = left
ID = 9990
stateno = 9990
helpertype = normal
name = "Fire"
sprpriority = -5
ownpal = 1
ignorehitpause = 1

[State 3001, Guardshake]
type = envshake
trigger1 = moveguarded
time = 4
ampl = 6
freq = 176
ignorehitpause = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = movecontact 
var(18) = 0

[State 1061, End]
type = destroyself
trigger1 = (pos x!=[-240,240])
trigger2 = time>180

[State 1061, Fade]
type = changestate
trigger1 = movecontact
value = 1030
ignorehitpause=1

;-------------------------------
;MEDIUM VERSION HELPER
[Statedef 1411]
type    = S
movetype= A
physics = N
anim = 1010
sprpriority = 5
hitcountpersist = 1
movehitpersist = 1

[State 1061, gethit gut ?]
type = VarSet
trigger1 = !time
var(14) = root,var(14)

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 1061, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = time = 0
var(18) = 1

[State 1061, Velocity]
type = VelSet
trigger1 = Time = 0
x = 6.5

[State 1061, Velocity]
type = VelSet
trigger1 = Movehit
x = 0

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

[State 1061, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 1061, HitOverride]
type = HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 1030
attr = SCA, AA, AP, AT
ignorehitpause = 1

[State 1061, Hitdef]
type = HitDef
trigger1 = var(14)=0
attr = S, SP
animtype  = hard
;damage    = ceil(13*root,fvar(12)), ceil(2*root,fvar(12))
damage = ceil(ifElse((root,fvar(11)) * 13 < 11, 4, (root,fvar(11)) * 13)), 2
priority  = 4,Hit
guardflag = MA
hitflag = MAF
pausetime = 0,10
sparkno = s7010
guard.sparkno = -1
sparkxy = 0,0
hitsound   = s1000,0
guardsound = S6,1
ground.type = high
air.type = low
ground.slidetime = 20;15
ground.hittime  = 25;15
ground.velocity = -7.8,0
guard.velocity = -7.5
air.velocity = -5.8,-3
airguard.velocity = -5, -4
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
air.fall = 0
fall.recover = 1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = 0,0  ;ifelse(p2movetype=H,40,140), 10
givepower = 35,35

[State 1061, Hitdef]
type = HitDef
trigger1 = var(14)=1
attr = S, SP
animtype  = hard
;damage    = ceil(13*root,fvar(12)), ceil(2*root,fvar(12))
damage = ceil(ifElse((root,fvar(11)) * 13 < 11, 4, (root,fvar(11)) * 13)), 2
priority  = 4,Hit
guardflag = MA
hitflag = MAF
pausetime = 0,10
sparkno = s7010
guard.sparkno = -1
sparkxy = 0,0
hitsound   = s1000,0
guardsound = S6,1
ground.type = low
air.type = low
ground.slidetime = 20;15
ground.hittime  = 25;15
ground.velocity = -7.8,0
guard.velocity = -7.5
air.velocity = -5.8,-3
airguard.velocity = -5, -4
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
air.fall = 0
fall.recover = 1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = 0,0  ;ifelse(p2movetype=H,40,140), 10
givepower = 35,35

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[State 1410, Helper Limiter]
type = Helper
triggerall = !NumHelper(9997)
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
helpertype = normal
name =  "Limiter"
ID = 9997
stateno = 9999
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1

[state 1410, Flame overlay]
type = helper
triggerall = !NumHelper(9990)
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
trigger1 = target,IsHelper=0
pos = 0,0
postype = left
ID = 9990
stateno = 9990
helpertype = normal
name = "Fire"
sprpriority = -5
ownpal = 1
ignorehitpause = 1

[State 3001, Guardshake]
type = envshake
trigger1 = moveguarded
time = 4
ampl = 6
freq = 176
ignorehitpause = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = movecontact 
var(18) = 0

[State 1061, End]
type = destroyself
trigger1 = (pos x!=[-240,240])
trigger2 = time>180

[State 1061, Fade]
type = changestate
trigger1 = movecontact
value = 1030
ignorehitpause=1

;-------------------------------
;STRONG VERSION HELPER
[Statedef 1412]
type    = S
movetype= A
physics = N
anim = 1010
sprpriority = 5
hitcountpersist = 1
movehitpersist = 1

[State 1061, gethit gut ?]
type = VarSet
trigger1 = !time
var(14) = root,var(14)

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 1061, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = time = 0
var(18) = 1

[State 1061, Velocity]
type = VelSet
trigger1 = Time = 0
x = 8

[State 1061, Velocity]
type = VelSet
trigger1 = Movehit
x = 0

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

[State 1061, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 1061, HitOverride]
type = HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 1030
attr = SCA, AA, AP, AT
ignorehitpause = 1

[State 1061, Hitdef]
type = HitDef
trigger1 = var(14)=0
attr = S, SP
animtype  = hard
;damage    = ceil(17*root,fvar(12)), ceil(4*root,fvar(12))
damage = ceil(ifElse((root,fvar(11)) * 17 < 14, 5, (root,fvar(11)) * 17)), 4
priority  = 4,Hit
guardflag = MA
hitflag = MAF
pausetime = 0,10
sparkno = s7010
guard.sparkno = -1
sparkxy = 0,0
hitsound   = s1000,0
guardsound = S6,1
ground.type = high
air.type = low
ground.slidetime = 20;15
ground.hittime  = 25;15
ground.velocity = -7.8,0
guard.velocity = -7.5
air.velocity = -5.8,-3
airguard.velocity = -5, -4
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
air.fall = 0
fall.recover = 1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = 0,0  ;ifelse(p2movetype=H,40,140), 10
givepower = 35,35

[State 1061, Hitdef]
type = HitDef
trigger1 = var(14)=1
attr = S, SP
animtype  = hard
;damage    = ceil(17*root,fvar(12)), ceil(4*root,fvar(12))
damage = ceil(ifElse((root,fvar(11)) * 17 < 14, 5, (root,fvar(11)) * 17)), 4
priority  = 4,Hit
guardflag = MA
hitflag = MAF
pausetime = 0,10
sparkno = s7010
guard.sparkno = -1
sparkxy = 0,0
hitsound   = s1000,0
guardsound = S6,1
ground.type = low
air.type = low
ground.slidetime = 20;15
ground.hittime  = 25;15
ground.velocity = -7.8,0
guard.velocity = -7.5
air.velocity = -5.8,-3
airguard.velocity = -5, -4
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
air.fall = 0
fall.recover = 1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = 0,0  ;ifelse(p2movetype=H,40,140), 10
givepower = 35,35

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[State 1410, Helper Limiter]
type = Helper
triggerall = !NumHelper(9997)
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
helpertype = normal
name =  "Limiter"
ID = 9997
stateno = 9999
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1

[state 1410, Flame overlay]
type = helper
triggerall = !NumHelper(9990)
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
trigger1 = target,IsHelper=0
pos = 0,0
postype = left
ID = 9990
stateno = 9990
helpertype = normal
name = "Fire"
sprpriority = -5
ownpal = 1
ignorehitpause = 1

[State 3001, Guardshake]
type = envshake
trigger1 = moveguarded
time = 4
ampl = 6
freq = 176
ignorehitpause = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = movecontact 
var(18) = 0

[State 1061, End]
type = destroyself
trigger1 = (pos x!=[-240,240])
trigger2 = time>180

[State 1061, Fade]
type = changestate
trigger1 = movecontact
value = 1030
ignorehitpause=1

;----------------------------------------------------
;MACHINE GUN PROJECTILE HELPER VANISHES

[Statedef 1030]
type    = A
movetype= A
physics = N
anim = 1013
sprpriority = 5
velset = -2,0

[State 1061, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 1061, NoJuggle Safety]
type = parentvarset
trigger1 = !time
var(18) = 0

[State 1002, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 1061, End]
type = destroyself
trigger1 = animtime = 0


;=====================================
; Run Dust FX
;=====================================

[Statedef 10000]
type = S
movetype = I
physics = N
anim = 10000
sprpriority = 5
velset = 0,0

[State 1061, Bind]
type = BindToRoot
trigger1 = 1
time = 1
pos = -40,4+ceil(-root,pos Y)

[State 1002, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 1061, End]
type = destroyself
trigger1 = animtime = 0


;========================================================
; AERIAL KI BLAST HELPER
; light = 1601
; Medium = 1611
; Strong = 1621
; Vanishes = 1630
;========================================================

;LIGHT VERSION HELPER
[Statedef 1601]
type    = S
movetype= A
physics = N
anim = 1010
sprpriority = 5
hitcountpersist = 1
movehitpersist = 1

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 1061, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 1061, Turn]
type = AngleDraw
trigger1 = 1
value = -90

[State 1061, NoJuggle]
type = parentvarset
trigger1 = time = 0
var(18) = 1

[State 1061, Velocity]
type = VelSet
trigger1 = Time = 0
y = 4

[State 1061, Velocity]
type = VelSet
trigger1 = Movehit
y = 0

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

[State 1061, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 1061, HitOverride]
type = HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 1630
attr = SCA, AA, AP, AT
ignorehitpause = 1

[State 1061, Hitdef]
type = HitDef
trigger1 = 1
attr = S, SP
animtype  = hard
;damage    = ceil(30*root,fvar(12)), ceil(3*root,fvar(12))
damage = ceil(ifElse((root,fvar(11)) * 30 < 7, 7, (root,fvar(11)) * 30)), 3
priority  = 4,Hit
guardflag = MA
hitflag = MAFD
pausetime = 0,10
sparkno = s7010
guard.sparkno = -1
sparkxy = 0,0
hitsound   = s1000,0
guardsound = S6,1
ground.type = high
air.type = low
ground.slidetime = 16 ;20
ground.hittime  = 16 ;25
ground.velocity = -2,0
guard.velocity = -2
air.velocity = -2,5
airguard.velocity = -2, 2
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
air.fall = 0
fall.recover = 1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = ifelse(p2movetype=H,40,140), 10
givepower = 35,35

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[State 3001, Guardshake]
type = envshake
trigger1 = moveguarded
time = 4
ampl = 6
freq = 176
ignorehitpause = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = movecontact 
var(18) = 0

[State 1061, End]
type = destroyself
trigger1 = (pos y!=[-10000,240])
trigger2 = time>180

[State 3055, end]
type = PlaySnd
trigger1 = pos y >= 0
value = s1000,0
persistent = 0

[State 1061, Fade]
type = changestate
trigger1 = movecontact
trigger2 = pos Y >= 0
value = 1630
ignorehitpause=1

;----------------------------------------------------
;MEDIUM VERSION HELPER
[Statedef 1611]
type    = S
movetype= A
physics = N
anim = 1010
sprpriority = 5
hitcountpersist = 1
movehitpersist = 1

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 1061, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 1061, Turn]
type = AngleDraw
trigger1 = 1
value = -90

[State 1061, NoJuggle]
type = parentvarset
trigger1 = time = 0
var(18) = 1

[State 1061, Velocity]
type = VelSet
trigger1 = Time = 0
y = 5.5

[State 1061, Velocity]
type = VelSet
trigger1 = Movehit
y = 0

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

[State 1061, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 1061, HitOverride]
type = HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 1630
attr = SCA, AA, AP, AT
ignorehitpause = 1

[State 1061, Hitdef]
type = HitDef
trigger1 = 1
attr = S, SP
animtype  = hard
;damage    = ceil(35*root,fvar(12)), ceil(3*root,fvar(12))
damage = ceil(ifElse((root,fvar(11)) * 35 < 7, 7, (root,fvar(11)) * 35)), 3
priority  = 4,Hit
guardflag = MA
hitflag = MAFD
pausetime = 0,10
sparkno = s7010
guard.sparkno = -1
sparkxy = 0,0
hitsound   = s1000,0
guardsound = S6,1
ground.type = high
air.type = low
ground.slidetime = 16 ;20
ground.hittime  = 16 ;25
ground.velocity = -2,0
guard.velocity = -2
air.velocity = -2,5
airguard.velocity = -2, 2
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
air.fall = 0
fall.recover = 1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = ifelse(p2movetype=H,40,140), 10
givepower = 35,35

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[State 3001, Guardshake]
type = envshake
trigger1 = moveguarded
time = 4
ampl = 6
freq = 176
ignorehitpause = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = movecontact 
var(18) = 0

[State 1061, End]
type = destroyself
trigger1 = (pos y!=[-10000,240])
trigger2 = time>180

[State 3055, end]
type = PlaySnd
trigger1 = pos y >= 0
value = s1000,0
persistent = 0

[State 1061, Fade]
type = changestate
trigger1 = movecontact
trigger2 = pos Y >= 0
value = 1630
ignorehitpause=1

;----------------------------------------------------
;STRONG VERSION HELPER
[Statedef 1621]
type    = S
movetype= A
physics = N
anim = 1010
sprpriority = 5
hitcountpersist = 1
movehitpersist = 1

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 1061, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 1061, Turn]
type = AngleDraw
trigger1 = 1
value = -90

[State 1061, NoJuggle]
type = parentvarset
trigger1 = time = 0
var(18) = 1

[State 1061, Velocity]
type = VelSet
trigger1 = Time = 0
y = 7

[State 1061, Velocity]
type = VelSet
trigger1 = Movehit
y = 0

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

[State 1061, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 1061, HitOverride]
type = HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 1630
attr = SCA, AA, AP, AT
ignorehitpause = 1

[State 1061, Hitdef]
type = HitDef
trigger1 = 1
attr = S, SP
animtype  = hard
;damage    = ceil(40*root,fvar(12)), ceil(4*root,fvar(12))
damage = ceil(ifElse((root,fvar(11)) * 40 < 7, 7, (root,fvar(11)) * 40)), 4
priority  = 4,Hit
guardflag = MA
hitflag = MAFD
pausetime = 0,10
sparkno = s7010
guard.sparkno = -1
sparkxy = 0,0
hitsound   = s1000,0
guardsound = S6,1
ground.type = high
air.type = low
ground.slidetime = 16 ;20
ground.hittime  = 16 ;25
ground.velocity = -2,0
guard.velocity = -2
air.velocity = -2,5
airguard.velocity = -2, 2
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
air.fall = 0
fall.recover = 1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = ifelse(p2movetype=H,40,140), 10
givepower = 35,35

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[State 3001, Guardshake]
type = envshake
trigger1 = moveguarded
time = 4
ampl = 6
freq = 176
ignorehitpause = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = movecontact 
var(18) = 0

[State 1061, End]
type = destroyself
trigger1 = (pos y!=[-10000,240])
trigger2 = time>180

[State 3055, end]
type = PlaySnd
trigger1 = pos y >= 0
value = s1000,0
persistent = 0

[State 1061, Fade]
type = changestate
trigger1 = movecontact
trigger2 = pos Y >= 0
value = 1630
ignorehitpause=1

;----------------------------------------------------
;AERIAL KI BLAST PROJECTILE HELPER VANISHES

[Statedef 1630]
type    = A
movetype= A
physics = N
anim = 1013
sprpriority = 5
velset = 0,-1

[State 1061, Turn]
type = AngleDraw
trigger1 = 1
value = -90

[State 1061, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 1061, NoJuggle Safety]
type = parentvarset
trigger1 = !time
var(18) = 0

[State 1002, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 1061, End]
type = destroyself
trigger1 = animtime = 0


;========================================================
; AERIAL MACHINE GUN TEMPER HELPER
; light = 1701
; Medium = 1711
; Strong = 1721
; Vanishes = 1630
;========================================================

;LIGHT MACHINE GUN TEMPER HELPER
[Statedef 1701]
type    = S
movetype= A
physics = N
anim = 1010
sprpriority = 5
hitcountpersist = 1
movehitpersist = 1

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 1061, transparency]
type = Trans
trigger1 = root,var(2)=1
trans = addalpha
alpha = 200,128
ignorehitpause = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = time = 0
var(18) = 1

[State 1061, Turn]
type = AngleDraw
trigger1 = 1
value = -90

[State 1061, Velocity]
type = VelSet
trigger1 = Time = 0
y = 5

[State 1061, Velocity]
type = VelSet
trigger1 = Movehit
y = 0

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

[State 1061, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 1061, HitOverride]
type = HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 1030
attr = SCA, AA, AP, AT
ignorehitpause = 1

[State 1061, Hitdef]
type = HitDef
trigger1 = 1
attr = S, SP
animtype  = hard
;damage    = ceil(12*root,fvar(12)), ceil(2*root,fvar(12))
damage = ceil(ifElse((root,fvar(11)) * 12 < 7, 7, (root,fvar(11)) * 12)), 2
priority  = 4,Hit
guardflag = MA
hitflag = MAFD
pausetime = 0,10
guard.pausetime = 2,1
sparkno = s7010
guard.sparkno = -1
sparkxy = 0,0
hitsound   = s1000,0; s1410,1 ;s1000,0
guardsound = S6,1
ground.type = high
air.type = low
ground.slidetime = 20 ;15
ground.hittime  = 25 ;15
guard.slidetime = 7
guard.hittime  = 7
ground.velocity = -2,0
guard.velocity = -2
air.velocity = -2,5
airguard.velocity = -2, 2
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
air.fall = 0
fall.recover = 1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = 0,0  ;ifelse(p2movetype=H,40,140), 10
givepower = 35,35

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[State 1410, Helper Limiter]
type = Helper
triggerall = !NumHelper(9997)
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
helpertype = normal
name =  "Limiter"
ID = 9997
stateno = 9999
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1

[state 1410, Flame overlay]
type = helper
triggerall = !NumHelper(9990)
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
trigger1 = target,IsHelper=0
pos = 0,0
postype = left
ID = 9990
stateno = 9990
helpertype = normal
name = "Fire"
sprpriority = -5
ownpal = 1
ignorehitpause = 1

[State 3001, Guardshake]
type = envshake
trigger1 = moveguarded
time = 4
ampl = 6
freq = 176
ignorehitpause = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = movecontact 
var(18) = 0

[State 1061, End]
type = destroyself
trigger1 = (pos y!=[-10000,240])
trigger2 = time>180

[State 3055, end]
type = PlaySnd
trigger1 = pos y >= 0
value = 1410,0
persistent = 0

[State 1061, Fade]
type = changestate
trigger1 = movecontact
trigger2 = pos Y >= 0
value = 1630
ignorehitpause=1

;---------------------------------
;MEDIUM MACHINE GUN TEMPER HELPER
[Statedef 1711]
type    = S
movetype= A
physics = N
anim = 1010
sprpriority = 5
hitcountpersist = 1
movehitpersist = 1

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 1061, transparency]
type = Trans
trigger1 = root,var(2)=1
trans = addalpha
alpha = 200,128
ignorehitpause = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = time = 0
var(18) = 1

[State 1061, Turn]
type = AngleDraw
trigger1 = 1
value = -90

[State 1061, Velocity]
type = VelSet
trigger1 = Time = 0
y = 6.5

[State 1061, Velocity]
type = VelSet
trigger1 = Movehit
y = 0

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

[State 1061, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 1061, HitOverride]
type = HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 1030
attr = SCA, AA, AP, AT
ignorehitpause = 1

[State 1061, Hitdef]
type = HitDef
trigger1 = 1
attr = S, SP
animtype  = hard
;damage    = ceil(14*root,fvar(12)), ceil(2*root,fvar(12))
damage = ceil(ifElse((root,fvar(11)) * 14 < 7, 7, (root,fvar(11)) * 14)), 2
priority  = 4,Hit
guardflag = MA
hitflag = MAFD
pausetime = 0,10
guard.pausetime = 2,1
sparkno = s7010
guard.sparkno = -1
sparkxy = 0,0
hitsound   = s1000,0; s1410,1 ;s1000,0
guardsound = S6,1
ground.type = high
air.type = low
ground.slidetime = 20 ;15
ground.hittime  = 25 ;15
guard.slidetime = 7
guard.hittime  = 7
ground.velocity = -2,0
guard.velocity = -2
air.velocity = -2,5
airguard.velocity = -2, 2
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
air.fall = 0
fall.recover = 1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = 0,0  ;ifelse(p2movetype=H,40,140), 10
givepower = 35,35

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[State 1410, Helper Limiter]
type = Helper
triggerall = !NumHelper(9997)
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
helpertype = normal
name =  "Limiter"
ID = 9997
stateno = 9999
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1

[state 1410, Flame overlay]
type = helper
triggerall = !NumHelper(9990)
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
trigger1 = target,IsHelper=0
pos = 0,0
postype = left
ID = 9990
stateno = 9990
helpertype = normal
name = "Fire"
sprpriority = -5
ownpal = 1
ignorehitpause = 1

[State 3001, Guardshake]
type = envshake
trigger1 = moveguarded
time = 4
ampl = 6
freq = 176
ignorehitpause = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = movecontact 
var(18) = 0

[State 1061, End]
type = destroyself
trigger1 = (pos y!=[-10000,240])
trigger2 = time>180

[State 3055, end]
type = PlaySnd
trigger1 = pos y >= 0
value = 1410,0
persistent = 0

[State 1061, Fade]
type = changestate
trigger1 = movecontact
trigger2 = pos Y >= 0
value = 1630
ignorehitpause=1

;---------------------------------
;STRONG MACHINE GUN TEMPER HELPER
[Statedef 1721]
type    = S
movetype= A
physics = N
anim = 1010
sprpriority = 5
hitcountpersist = 1
movehitpersist = 1

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 1061, transparency]
type = Trans
trigger1 = root,var(2)=1
trans = addalpha
alpha = 200,128
ignorehitpause = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = time = 0
var(18) = 1

[State 1061, Turn]
type = AngleDraw
trigger1 = 1
value = -90

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

[State 1061, Velocity]
type = VelSet
trigger1 = Movehit
y = 0

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

[State 1061, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 1061, HitOverride]
type = HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 1030
attr = SCA, AA, AP, AT
ignorehitpause = 1

[State 1061, Hitdef]
type = HitDef
trigger1 = 1
attr = S, SP
animtype  = hard
;damage    = ceil(16*root,fvar(12)), ceil(2*root,fvar(12))
damage = ceil(ifElse((root,fvar(11)) * 16 < 7, 7, (root,fvar(11)) * 16)), 2
priority  = 4,Hit
guardflag = MA
hitflag = MAFD
pausetime = 0,10
guard.pausetime = 2,1
sparkno = s7010
guard.sparkno = -1
sparkxy = 0,0
hitsound   = s1000,0; s1410,1 ;s1000,0
guardsound = S6,1
ground.type = high
air.type = low
ground.slidetime = 20 ;15
ground.hittime  = 25 ;15
guard.slidetime = 7
guard.hittime  = 7
ground.velocity = -2,0
guard.velocity = -2
air.velocity = -2,5
airguard.velocity = -2, 2
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
air.fall = 0
fall.recover = 1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = 0,0  ;ifelse(p2movetype=H,40,140), 10
givepower = 35,35

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[State 1410, Helper Limiter]
type = Helper
triggerall = !NumHelper(9997)
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
helpertype = normal
name =  "Limiter"
ID = 9997
stateno = 9999
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1

[state 1410, Flame overlay]
type = helper
triggerall = !NumHelper(9990)
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
trigger1 = target,IsHelper=0
pos = 0,0
postype = left
ID = 9990
stateno = 9990
helpertype = normal
name = "Fire"
sprpriority = -5
ownpal = 1
ignorehitpause = 1

[State 3001, Guardshake]
type = envshake
trigger1 = moveguarded
time = 4
ampl = 6
freq = 176
ignorehitpause = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = movecontact 
var(18) = 0

[State 1061, End]
type = destroyself
trigger1 = (pos y!=[-10000,240])
trigger2 = time>180

[State 3055, end]
type = PlaySnd
trigger1 = pos y >= 0
value = 1410,0
persistent = 0

[State 1061, Fade]
type = changestate
trigger1 = movecontact
trigger2 = pos Y >= 0
value = 1630
ignorehitpause=1

;========================================================
; KI BLAST HELPER
;light uncharged : 1005
;light charge 1 : 1006
;light max charge : 1007
;========================================================

;light ki blast uncharged
[Statedef 1005]
type    = S
movetype= A
physics = N
anim = 1010
sprpriority = 5
hitcountpersist = 1
movehitpersist = 1

[State 1061, gethit gut ?]
type = VarSet
trigger1 = !time
var(14) = root,var(14)

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 1061, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = time = 0
var(18) = 1

[State 1061, Velocity]
type = VelSet
trigger1 = Time = 0
x = 4

[State 1061, Velocity]
type = VelSet
trigger1 = Movehit
x = 0

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

[State 1061, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 1061, HitOverride]
type = HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 1030
attr = SCA, AA, AP, AT
ignorehitpause = 1

[State 1061, Hitdef]
type = HitDef
trigger1 = var(14)=0
attr = S, SP
animtype  = hard
;damage    = ceil(30*root,fvar(12)), ceil(5*root,fvar(12))
damage = ceil(ifElse((root,fvar(11)) * 30 < 7, 7, (root,fvar(11)) * 30)), 5
priority  = 4,Hit
guardflag = MA
hitflag = MAF
pausetime = 0,10
sparkno = s7010
guard.sparkno = -1
sparkxy = 0,0
hitsound   = s1000,0
guardsound = S6,1
ground.type = high
air.type = low
ground.slidetime = 16 ;20
ground.hittime  = 16 ;20
ground.velocity = -7.8,0
guard.velocity = -7.5
air.velocity = -5.8,-3
airguard.velocity = -5, -4
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
air.fall = 0
fall.recover = 1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = ifelse(p2movetype=H,40,140), 10
givepower = 35,35

[State 1061, Hitdef]
type = HitDef
trigger1 = var(14)=1
attr = S, SP
animtype  = hard
;damage    = ceil(30*root,fvar(12)), ceil(5*root,fvar(12))
damage = ceil(ifElse((root,fvar(11)) * 30 < 7, 7, (root,fvar(11)) * 30)), 5
priority  = 4,Hit
guardflag = MA
hitflag = MAF
pausetime = 0,10
sparkno = s7010
guard.sparkno = -1
sparkxy = 0,0
hitsound   = s1000,0
guardsound = S6,1
ground.type = low
air.type = low
ground.slidetime = 16 ;20
ground.hittime  = 16 ;20
ground.velocity = -7.8,0
guard.velocity = -7.5
air.velocity = -5.8,-3
airguard.velocity = -5, -4
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
air.fall = 0
fall.recover = 1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = ifelse(p2movetype=H,40,140), 10
givepower = 35,35

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[State 3001, Guardshake]
type = envshake
trigger1 = moveguarded
time = 4
ampl = 6
freq = 176
ignorehitpause = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = movecontact 
var(18) = 0

[State 1061, End]
type = destroyself
trigger1 = (pos x!=[-240,240])
trigger2 = time>180

[State 1061, Fade]
type = changestate
trigger1 = movecontact
value = 1030
ignorehitpause=1

;-------------------------------------
;light ki blast charge 1
[Statedef 1006]
type    = S
movetype= A
physics = N
anim = 1006
sprpriority = 5

[State 1061, gethit gut ?]
type = VarSet
trigger1 = !time
var(14) = root,var(14)

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 3005, hitvar]
type=varadd
trigger1= !time
var(2)=1

[State 1061, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = time = 0
var(18) = 1

[State 1061, Velocity]
type = VelSet
trigger1 = Time = 0
x = 6

[State 1061, Velocity]
type = VelSet
trigger1 = Movehit
x = ifelse((time<2 && var(2)>1),1,6)

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

[State 1061, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 1061, HitOverride]
type = HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = ifelse(var(2)<2,1006,1030)
attr = SCA, AA, AP, AT
ignorehitpause = 1

[State 1061, Hitdef]
type = HitDef
trigger1 = var(14)=0
attr = S, SP
animtype  = hard
;damage    = ceil(25*root,fvar(12)), ceil(4*root,fvar(12))
damage = ceil(ifElse((root,fvar(11)) * 25 < 7, 7, (root,fvar(11)) * 25)), 4
priority  = 4,Hit
guardflag = MA
hitflag = MAF
pausetime = 4*(var(2)<2),10
sparkno = s7010
guard.sparkno = -1
sparkxy = 0,0
hitsound   = s1000,0
guardsound = S6,1
ground.type = high
air.type = low
ground.slidetime = 16 ;20
ground.hittime  = 16 ;20
ground.velocity = ifelse(var(2)<2, -1, -7),0
guard.velocity = -7.5
air.velocity = -5.8,-3
airguard.velocity = -5, -4
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
air.fall = 0
fall.recover = 1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = ifelse(p2movetype=H,40,140), 10
givepower = 35,35

[State 1061, Hitdef]
type = HitDef
trigger1 = var(14)=1
attr = S, SP
animtype  = hard
;damage    = ceil(25*root,fvar(12)), ceil(4*root,fvar(12))
damage = ceil(ifElse((root,fvar(11)) * 25 < 7, 7, (root,fvar(11)) * 25)), 4
priority  = 4,Hit
guardflag = MA
hitflag = MAF
pausetime = 4*(var(2)<2),10
sparkno = s7010
guard.sparkno = -1
sparkxy = 0,0
hitsound   = s1000,0
guardsound = S6,1
ground.type = low
air.type = low
ground.slidetime = 16 ;20
ground.hittime  = 16 ;20
ground.velocity = -7.8,0
guard.velocity = -7.5
air.velocity = -5.8,-3
airguard.velocity = -5, -4
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
air.fall = 0
fall.recover = 1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = ifelse(p2movetype=H,40,140), 10
givepower = 35,35

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[State 3001, Guardshake]
type = envshake
trigger1 = moveguarded
time = 4
ampl = 6
freq = 176
ignorehitpause = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = movecontact 
var(18) = 0

[State 1061, End]
type = destroyself
trigger1 = (pos x!=[-240,240])
trigger2 = time>180

[State 1061, Fade]
type = changestate
trigger1 = movecontact
value = ifelse(var(2)<2,1006,1030)
ignorehitpause=1

;-------------------------------------
;light ki blast charge MAX
[Statedef 1007]
type    = S
movetype= A
physics = N
anim = 1007
sprpriority = 5

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 3005, hitvar]
type=varadd
trigger1= !time
var(2)=1

[State 1061, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = time = 0
var(18) = 1

[State 1061, Velocity]
type = VelSet
trigger1 = Time = 0
x = 7.5

[State 1061, Velocity]
type = VelSet
trigger1 = Movehit
x = ifelse((time<2 && var(2)>1),1,7.5)

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

[State 1061, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 1061, HitOverride]
type = HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = ifelse(var(2)<2,1007,1030)
attr = SCA, AA, AP, AT
ignorehitpause = 1

[State 1061, Hitdef]
type = HitDef
trigger1 = 1
attr = S, SP
animtype  = hard
;damage    = ceil(24*root,fvar(12)), ceil(4*root,fvar(12))
damage = ceil(ifElse((root,fvar(11)) * 24 < 7, 7, (root,fvar(11)) * 24)), 4
priority  = 4,Hit
guardflag = MA
hitflag = MAF
pausetime = 4*(var(2)<3),10
sparkno = s7010
guard.sparkno = -1
sparkxy = 0,0
hitsound   = s1000,0
guardsound = S6,1
ground.type = low
air.type = low
ground.slidetime = 16 ;20
ground.hittime  = 16 ;20
ground.velocity = ifelse(var(2)<3, -1, -7),ifelse(var(2)<3, -1, -5)
guard.velocity = -7.5
air.velocity = -5.8,-3
airguard.velocity = -5, -4
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
air.fall = 1
fall = var(2)=3
fall.recover = 0
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = ifelse(p2movetype=H,40,140), 10
givepower = 35,35

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[state 1215, Explosion FX]
type = explod
trigger1 = movecontact && !numexplod(2512)
anim = 2512
id = 2512
pos = 10,0
postype = P1
sprpriority = 6
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 0
;bindtime = -1
[State 13100, explosion sound]
type = playsnd
trigger1 = movecontact
value = 1000,0

[State 3001, Guardshake]
type = envshake
trigger1 = moveguarded
time = 4
ampl = 6
freq = 176
ignorehitpause = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = movecontact 
var(18) = 0

[State 1061, End]
type = destroyself
trigger1 = (pos x!=[-240,240])
trigger2 = time>180

[State 1061, Fade]
type = changestate
trigger1 = movecontact
value = ifelse(var(2)<3,1007,1030)
ignorehitpause=1

;-------------------------------------
;Medium ki blast uncharged
[Statedef 1015]
type    = S
movetype= A
physics = N
anim = 1010
sprpriority = 5

[State 1061, gethit gut ?]
type = VarSet
trigger1 = !time
var(14) = root,var(14)

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 1061, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = time = 0
var(18) = 1

[State 1061, Velocity]
type = VelSet
trigger1 = Time = 0
x = 6

[State 1061, Velocity]
type = VelSet
trigger1 = Movehit
x = 0

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

[State 1061, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 1061, HitOverride]
type = HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 1030
attr = SCA, AA, AP, AT
ignorehitpause = 1

[State 1061, Hitdef]
type = HitDef
trigger1 = var(14)=0
attr = S, SP
animtype  = hard
;damage    = ceil(40*root,fvar(12)), ceil(6*root,fvar(12))
damage = ceil(ifElse((root,fvar(11)) * 40 < 7, 7, (root,fvar(11)) * 40)), 6
priority  = 4,Hit
guardflag = MA
hitflag = MAF
pausetime = 0,10
sparkno = s7010
guard.sparkno = -1
sparkxy = 0,0
hitsound   = s1000,0
guardsound = S6,1
ground.type = high
air.type = low
ground.slidetime = 16 ;20
ground.hittime  = 16 ;20
ground.velocity = -7.8,0
guard.velocity = -7.5
air.velocity = -5.8,-3
airguard.velocity = -5, -4
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
air.fall = 0
fall.recover = 1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = ifelse(p2movetype=H,40,140), 10
givepower = 35,35

[State 1061, Hitdef]
type = HitDef
trigger1 = var(14)=1
attr = S, SP
animtype  = hard
;damage    = ceil(40*root,fvar(12)), ceil(6*root,fvar(12))
damage = ceil(ifElse((root,fvar(11)) * 40 < 7, 7, (root,fvar(11)) * 40)), 6
priority  = 4,Hit
guardflag = MA
hitflag = MAF
pausetime = 0,10
sparkno = s7010
guard.sparkno = -1
sparkxy = 0,0
hitsound   = s1000,0
guardsound = S6,1
ground.type = low
air.type = low
ground.slidetime = 16 ;20
ground.hittime  = 16 ;20
ground.velocity = -7.8,0
guard.velocity = -7.5
air.velocity = -5.8,-3
airguard.velocity = -5, -4
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
air.fall = 0
fall.recover = 1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = ifelse(p2movetype=H,40,140), 10
givepower = 35,35

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[State 3001, Guardshake]
type = envshake
trigger1 = moveguarded
time = 4
ampl = 6
freq = 176
ignorehitpause = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = movecontact 
var(18) = 0

[State 1061, End]
type = destroyself
trigger1 = (pos x!=[-240,240])
trigger2 = time>180

[State 1061, Fade]
type = changestate
trigger1 = movecontact
value = 1030
ignorehitpause=1

;-------------------------------------
;Medium ki blast charge 1
[Statedef 1016]
type    = S
movetype= A
physics = N
anim = 1006
sprpriority = 5

[State 1061, gethit gut ?]
type = VarSet
trigger1 = !time
var(14) = root,var(14)

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 3005, hitvar]
type=varadd
trigger1= !time
var(2)=1

[State 1061, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = time = 0
var(18) = 1

[State 1061, Velocity]
type = VelSet
trigger1 = Time = 0
x = 7.5

[State 1061, Velocity]
type = VelSet
trigger1 = Movehit
x = ifelse((time<2 && var(2)>1),1,7.5)

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

[State 1061, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 1061, HitOverride]
type = HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = ifelse(var(2)<2,1016,1030)
attr = SCA, AA, AP, AT
ignorehitpause = 1

[State 1061, Hitdef]
type = HitDef
trigger1 = var(14)=0
attr = S, SP
animtype  = hard
;damage    = ceil(30*root,fvar(12)), ceil(4*root,fvar(12))
damage = ceil(ifElse((root,fvar(11)) * 30 < 7, 7, (root,fvar(11)) * 30)), 4
priority  = 4,Hit
guardflag = MA
hitflag = MAF
pausetime = 4*(var(2)<2),10
sparkno = s7010
guard.sparkno = -1
sparkxy = 0,0
hitsound   = s1000,0
guardsound = S6,1
ground.type = high
air.type = low
ground.slidetime = 16 ;20
ground.hittime  = 16 ;20
ground.velocity = ifelse(var(2)<2, -1, -7),0
guard.velocity = -7.5
air.velocity = -5.8,-3
airguard.velocity = -5, -4
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
air.fall = 0
fall.recover = 1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = ifelse(p2movetype=H,40,140), 10
givepower = 35,35

[State 1061, Hitdef]
type = HitDef
trigger1 = var(14)=1
attr = S, SP
animtype  = hard
;damage    = ceil(30*root,fvar(12)), ceil(4*root,fvar(12))
damage = ceil(ifElse((root,fvar(11)) * 30 < 7, 7, (root,fvar(11)) * 30)), 4
priority  = 4,Hit
guardflag = MA
hitflag = MAF
pausetime = 4*(var(2)<2),10
sparkno = s7010
guard.sparkno = -1
sparkxy = 0,0
hitsound   = s1000,0
guardsound = S6,1
ground.type = low
air.type = low
ground.slidetime = 16 ;20
ground.hittime  = 16 ;20
ground.velocity = ifelse(var(2)<2, -1, -7),0
guard.velocity = -7.5
air.velocity = -5.8,-3
airguard.velocity = -5, -4
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
air.fall = 0
fall.recover = 0
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = ifelse(p2movetype=H,40,140), 10
givepower = 35,35

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[State 3001, Guardshake]
type = envshake
trigger1 = moveguarded
time = 4
ampl = 6
freq = 176
ignorehitpause = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = movecontact 
var(18) = 0

[State 1061, End]
type = destroyself
trigger1 = (pos x!=[-240,240])
trigger2 = time>180

[State 1061, Fade]
type = changestate
trigger1 = movecontact
value = ifelse(var(2)<2,1016,1030)
ignorehitpause=1

;-------------------------------------
;Medium ki blast charge MAX
[Statedef 1017]
type    = S
movetype= A
physics = N
anim = 1007
sprpriority = 5

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 1061, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 3005, hitvar]
type=varadd
trigger1= !time
var(2)=1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = time = 0
var(18) = 1

[State 1061, Velocity]
type = VelSet
trigger1 = Time = 0
x = 8.5

[State 1061, Velocity]
type = VelSet
trigger1 = Movehit
x = ifelse((time<2 && var(2)>1),1,8.5)

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

[State 1061, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 1061, HitOverride]
type = HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = ifelse(var(2)<2,1017,1030)
attr = SCA, AA, AP, AT
ignorehitpause = 1

[State 1061, Hitdef]
type = HitDef
trigger1 = 1
attr = S, SP
animtype  = hard
;damage    = ceil(27*root,fvar(12)), ceil(4*root,fvar(12))
damage = ceil(ifElse((root,fvar(11)) * 27 < 7, 7, (root,fvar(11)) * 27)), 4
priority  = 4,Hit
guardflag = MA
hitflag = MAF
pausetime = 4*(var(2)<3),10
sparkno = s7010
guard.sparkno = -1
sparkxy = 0,0
hitsound   = s1000,0
guardsound = S6,1
ground.type = low
air.type = low
ground.slidetime = 16 ;20
ground.hittime  = 16 ;20
ground.velocity = ifelse(var(2)<3, -1, -7),ifelse(var(2)<3, -1, -5)
guard.velocity = -7.5
air.velocity = -5.8,-3
airguard.velocity = -5, -4
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
air.fall = 1
fall = var(2)=3
fall.recover = 0
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = ifelse(p2movetype=H,40,140), 10
givepower = 35,35

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[state 1215, Explosion FX]
type = explod
trigger1 = movecontact && !numexplod(2512)
anim = 2512
id = 2512
pos = 10,0
postype = P1
sprpriority = 6
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 0
;bindtime = -1
[State 13100, explosion sound]
type = playsnd
trigger1 = movecontact
value = 1000,0

[State 3001, Guardshake]
type = envshake
trigger1 = moveguarded
time = 4
ampl = 6
freq = 176
ignorehitpause = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = movecontact 
var(18) = 0

[State 1061, End]
type = destroyself
trigger1 = (pos x!=[-240,240])
trigger2 = time>180

[State 1061, Fade]
type = changestate
trigger1 = movecontact
value = ifelse(var(2)<3,1017,1030)
ignorehitpause=1

;-------------------------------------
;Strong ki blast uncharged
[Statedef 1025]
type    = S
movetype= A
physics = N
anim = 1010
sprpriority = 5

[State 1061, gethit gut ?]
type = VarSet
trigger1 = !time
var(14) = root,var(14)

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 1061, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = time = 0
var(18) = 1

[State 1061, Velocity]
type = VelSet
trigger1 = Time = 0
x = 8

[State 1061, Velocity]
type = VelSet
trigger1 = Movehit
x = 0

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

[State 1061, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 1061, HitOverride]
type = HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 1030
attr = SCA, AA, AP, AT
ignorehitpause = 1

[State 1061, Hitdef]
type = HitDef
trigger1 = var(14)=0
attr = S, SP
animtype  = hard
;damage    = ceil(50*root,fvar(12)), ceil(8*root,fvar(12))
damage = ceil(ifElse((root,fvar(11)) * 50 < 7, 7, (root,fvar(11)) * 50)), 8
priority  = 4,Hit
guardflag = MA
hitflag = MAF
pausetime = 0,10
sparkno = s7010
guard.sparkno = -1
sparkxy = 0,0
hitsound   = s1000,0
guardsound = S6,1
ground.type = high
air.type = low
ground.slidetime = 16 ;20
ground.hittime  = 16 ;20
ground.velocity = -7.8,0
guard.velocity = -7.5
air.velocity = -5.8,-3
airguard.velocity = -5, -4
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
air.fall = 0
fall.recover = 1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = ifelse(p2movetype=H,40,140), 10
givepower = 35,35

[State 1061, Hitdef]
type = HitDef
trigger1 = var(14)=1
attr = S, SP
animtype  = hard
;damage    = ceil(50*root,fvar(12)), ceil(8*root,fvar(12))
damage = ceil(ifElse((root,fvar(11)) * 50 < 7, 7, (root,fvar(11)) * 50)), 8
priority  = 4,Hit
guardflag = MA
hitflag = MAF
pausetime = 0,10
sparkno = s7010
guard.sparkno = -1
sparkxy = 0,0
hitsound   = s1000,0
guardsound = S6,1
ground.type = low
air.type = low
ground.slidetime = 16 ;20
ground.hittime  = 16 ;20
ground.velocity = -7.8,0
guard.velocity = -7.5
air.velocity = -5.8,-3
airguard.velocity = -5, -4
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
air.fall = 0
fall.recover = 1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = ifelse(p2movetype=H,40,140), 10
givepower = 35,35

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[State 3001, Guardshake]
type = envshake
trigger1 = moveguarded
time = 4
ampl = 6
freq = 176
ignorehitpause = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = movecontact 
var(18) = 0

[State 1061, End]
type = destroyself
trigger1 = (pos x!=[-240,240])
trigger2 = time>180

[State 1061, Fade]
type = changestate
trigger1 = movecontact
value = 1030
ignorehitpause=1

;-------------------------------------
;Strong ki blast charge 1
[Statedef 1026]
type    = S
movetype= A
physics = N
anim = 1006
sprpriority = 5

[State 1061, gethit gut ?]
type = VarSet
trigger1 = !time
var(14) = root,var(14)

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 3005, hitvar]
type=varadd
trigger1= !time
var(2)=1

[State 1061, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = time = 0
var(18) = 1

[State 1061, Velocity]
type = VelSet
trigger1 = Time = 0
x = 9

[State 1061, Velocity]
type = VelSet
trigger1 = Movehit
x = ifelse((time<2 && var(2)>1),1,9)

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

[State 1061, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 1061, HitOverride]
type = HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = ifelse(var(2)<2,1026,1030)
attr = SCA, AA, AP, AT
ignorehitpause = 1

[State 1061, Hitdef]
type = HitDef
trigger1 = var(14)=0
attr = S, SP
animtype  = hard
;damage    = ceil(35*root,fvar(12)), ceil(5*root,fvar(12))
damage = ceil(ifElse((root,fvar(11)) * 35 < 7, 7, (root,fvar(11)) * 35)), 5
priority  = 4,Hit
guardflag = MA
hitflag = MAF
pausetime = 4*(var(2)<2),10
sparkno = s7010
guard.sparkno = -1
sparkxy = 0,0
hitsound   = s1000,0
guardsound = S6,1
ground.type = high
air.type = low
ground.slidetime = 16 ;20
ground.hittime  = 16 ;20
ground.velocity = ifelse(var(2)<2, -1, -7),0
guard.velocity = -7.5
air.velocity = -5.8,-3
airguard.velocity = -5, -4
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
air.fall = 0
fall.recover = 1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = ifelse(p2movetype=H,40,140), 10
givepower = 35,35

[State 1061, Hitdef]
type = HitDef
trigger1 = var(14)=1
attr = S, SP
animtype  = hard
;damage    = ceil(35*root,fvar(12)), ceil(5*root,fvar(12))
damage = ceil(ifElse((root,fvar(11)) * 35 < 7, 7, (root,fvar(11)) * 35)), 5
priority  = 4,Hit
guardflag = MA
hitflag = MAF
pausetime = 4*(var(2)<2),10
sparkno = s7010
guard.sparkno = -1
sparkxy = 0,0
hitsound   = s1000,0
guardsound = S6,1
ground.type = low
air.type = low
ground.slidetime = 16 ;20
ground.hittime  = 16 ;20
ground.velocity = ifelse(var(2)<2, -1, -7),0
guard.velocity = -7.5
air.velocity = -5.8,-3
airguard.velocity = -5, -4
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
air.fall = 0
fall.recover = 1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = ifelse(p2movetype=H,40,140), 10
givepower = 35,35

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[State 3001, Guardshake]
type = envshake
trigger1 = moveguarded
time = 4
ampl = 6
freq = 176
ignorehitpause = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = movecontact 
var(18) = 0

[State 1061, End]
type = destroyself
trigger1 = (pos x!=[-240,240])
trigger2 = time>180

[State 1061, Fade]
type = changestate
trigger1 = movecontact
value = ifelse(var(2)<2,1026,1030)
ignorehitpause=1

;-------------------------------------
;Strong ki blast charge MAX
[Statedef 1027]
type    = S
movetype= A
physics = N
anim = 1007
sprpriority = 5

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 1061, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 3005, hitvar]
type=varadd
trigger1= !time
var(2)=1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = time = 0
var(18) = 1

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

[State 1061, Velocity]
type = VelSet
trigger1 = Movehit
x = ifelse((time<2 && var(2)>1),1,10)

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

[State 1061, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 1061, HitOverride]
type = HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = ifelse(var(2)<2,1027,1030)
attr = SCA, AA, AP, AT
ignorehitpause = 1

[State 1061, Hitdef]
type = HitDef
trigger1 = 1
attr = S, SP
animtype  = hard
;damage    = ceil(30*root,fvar(12)), ceil(5*root,fvar(12))
damage = ceil(ifElse((root,fvar(11)) * 30 < 7, 7, (root,fvar(11)) * 30)), 5
priority  = 4,Hit
guardflag = MA
hitflag = MAF
pausetime = 4*(var(2)<3),10
sparkno = s7010
guard.sparkno = -1
sparkxy = 0,0
hitsound   = s1000,0
guardsound = S6,1
ground.type = low
air.type = low
ground.slidetime = 16 ;20
ground.hittime  = 16 ;20
ground.velocity = ifelse(var(2)<2, -1, -7),ifelse(var(2)<2, -1, -5)
guard.velocity = -7.5
air.velocity = -5.8,-3
airguard.velocity = -5, -4
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
air.fall = 1
fall = var(2)=3
fall.recover = 0
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = ifelse(p2movetype=H,40,140), 10
givepower = 35,35

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[state 1215, Explosion FX]
type = explod
trigger1 = movecontact && !numexplod(2512)
anim = 2512
id = 2512
pos = 10,0
postype = P1
sprpriority = 6
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 0
;bindtime = -1
[State 13100, explosion sound]
type = playsnd
trigger1 = movecontact
value = 1000,0

[State 3001, Guardshake]
type = envshake
trigger1 = moveguarded
time = 4
ampl = 6
freq = 176
ignorehitpause = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = movecontact 
var(18) = 0

[State 1061, End]
type = destroyself
trigger1 = (pos x!=[-240,240])
trigger2 = time>180

[State 1061, Fade]
type = changestate
trigger1 = movecontact
value = ifelse(var(2)<3,1027,1030)
ignorehitpause=1

;-------------------------------------
;EX ki blast charge
[Statedef 1051]
type    = S
movetype= A
physics = N
anim = 1007
sprpriority = 5

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 1061, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 3005, hitvar]
type=varadd
trigger1= !time
var(2)=1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = time = 0
var(18) = 1

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

[State 1061, Velocity]
type = VelSet
trigger1 = Movehit
x = ifelse((time<2 && var(2)>1),1,10)

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

[State 1061, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 1061, HitOverride]
type = HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = ifelse(var(2)<2,1051,1030)
attr = SCA, AA, AP, AT
ignorehitpause = 1

[State 1061, Hitdef]
type = HitDef
trigger1 = 1
attr = S, SP
animtype  = hard
;damage    = ceil(30*root,fvar(12)), ceil(5*root,fvar(12))
damage = ceil(ifElse((root,fvar(11)) * 30 < 7, 7, (root,fvar(11)) * 30)), 5
priority  = 4,Hit
guardflag = MA
hitflag = MAF
pausetime = 4*(var(2)<3),10
sparkno = s7010
guard.sparkno = -1
sparkxy = 0,0
hitsound   = s1000,0
guardsound = S6,1
ground.type = low
air.type = low
ground.slidetime = 16 ;20
ground.hittime  = 16 ;20
ground.velocity = ifelse(var(2)<2, -1, -7),ifelse(var(2)<2, -1, -5)
guard.velocity = -7.5
air.velocity = -5.8,-3
airguard.velocity = -5, -4
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
air.fall = 1
fall = var(2)=3
fall.recover = 0
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = 0,0
givepower = 35,35

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[state 1215, Explosion FX]
type = explod
trigger1 = movecontact && !numexplod(2512)
anim = 2512
id = 2512
pos = 10,0
postype = P1
sprpriority = 6
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 0
;bindtime = -1
[State 13100, explosion sound]
type = playsnd
trigger1 = movecontact
value = 1000,0

[State 3001, Guardshake]
type = envshake
trigger1 = moveguarded
time = 4
ampl = 6
freq = 176
ignorehitpause = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = movecontact 
var(18) = 0

[State 1061, End]
type = destroyself
trigger1 = (pos x!=[-240,240])
trigger2 = time>180

[State 1061, Fade]
type = changestate
trigger1 = movecontact
value = ifelse(var(2)<3,1051,1030)
ignorehitpause=1


;==========================================================
; GALICK HO HELPER

[Statedef 2001]
type = A
physics = N
movetype = A
ctrl = 0
sprpriority = 5

[State 3005, anim]
type = changeanim
trigger1 = !time
value = 2001
elem = random%4

[State 1061, NoJuggle]
type = parentvarset
trigger1 = time = 0
var(18) = 1

[State 3005, hitvar]
type=varadd
trigger1= !time
var(2)=1

[State 13100, goes SND]
type = playsnd
trigger1 =  !time
value = 2000,6

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 1061, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

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

[State 1061, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 1061, HitOverride]
type = HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 2002
attr = SCA, NP, SP, HP
ignorehitpause = 1

[State 1061, Velocity]
type = VelSet
trigger1 = 1
x = ifelse((time<2 && var(2)>1),1,10)

[State 3005, hit]
type = hitdef
trigger1 = 1
attr = S,HP
hitflag = MAF
guardflag = MA
priority = 7,Hit
;damage = ceil(35*root,fvar(12)), 4
;damage = ceil(ifElse((root,fvar(11)) * 35 < 7, 7, (root,fvar(11)) * 35)), 4
damage = ceil(ifElse((root,fvar(11)) * 35 < 10, 10, (root,fvar(11)) * 35)), 4
getpower = 0,0
givepower = 35,35
pausetime = 4,6
animtype = Back
air.animtype = Back
fall.animtype = Back
ground.type = High
air.type = Low
ground.hittime = 16
ground.slidetime = 16
guard.hittime = 16
air.hittime = 13
airguard.ctrltime = 16
ground.velocity= 0,0
guard.velocity = -9
air.velocity = -5.5,-3.9
airguard.velocity = -5.5, -1.5 
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
yaccel = .5
fall=0
air.fall = 1
fall.recover = 0
fall.recovertime = 13
sparkno = -1
hitsound   = s2400,11
guardsound = S6,1
envshake.time = 16
envshake.ampl = 6
envshake.freq = 100
forcestand = 1
palfx.sinadd=64,64,64,4
palfx.mul=128,128,128
palfx.time=32
p1sprpriority = 5

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = movecontact 
var(18) = 0

[State 1315, Sparks]
type=explod
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
anim=7020
sprpriority=3
postype=p2
pos=(target,const(size.ground.front)-10),-floor(p2dist y)
removetime=-2
ownpal=1
facing=-1
ignorehitpause=1
persistent=0
pausemovetime=100
supermovetime=100

[State 3005, end]
type = changestate
trigger1 = movecontact
value = 2002

[State 3001, Guardshake]
type = envshake
trigger1 = movecontact=1 && numtarget
time = 4
ampl = 6
freq = 176
ignorehitpause = 1

[State 1061, End]
type = destroyself
trigger1 = pos x!=[-240,240]

;-----------------------------------------
; Galick Ho explod/vanish
[Statedef 2002]
type=A
physics=N
movetype=I
velset=2,0
ctrl=0
sprpriority=5

[State 1308, nothitby]
type = nothitby
trigger1 = 1
time = 1
value = SCA
ignorehitpause = 1

[State 3005, anim]
type = changeanim
trigger1 = !time
value = 2006

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 1061, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 1316, End]
type=null;destroyself
trigger1= !animtime
[State 1316, End with Zzyzzyxx fix]
type= destroyself
;triggerall = !animtime
trigger1 = !numtarget
trigger2 = numtarget
trigger2 = target, time <= 1 && !(target, hitshakeover)

;==========================================================
; GALICK HO HELPER LAST

[Statedef 2003]
type = A
physics = N
movetype = A
ctrl = 0
sprpriority = 5

[State 3005, anim]
type = changeanim
trigger1 = !time && !prevstateno
value = 2001

[State 1061, NoJuggle]
type = parentvarset
trigger1 = time = 0
var(18) = 1

[State 3005, hitvar]
type=varadd
trigger1= !time
var(2)=1

[State 1055, movehitvar]
type=varset
trigger1= movecontact && numtarget
trigger1= !(target,ishelper)
var(3)=1
ignorehitpause=1

[State 13100, goes SND]
type = playsnd
trigger1 =  !time
value = 2000,6

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 1061, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

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

[State 1061, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 1061, HitOverride]
type = HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 2002
attr = SCA, NP, SP, HP
ignorehitpause = 1

[State 1061, Velocity]
type = VelSet
trigger1 = 1
x = ifelse((time<2 && var(2)>1),1,10)

[State 3005, hit]
type = hitdef
trigger1 = 1
attr = S,HP
hitflag = MAF
guardflag = MA
priority = 7,Hit
;damage = ceil(35*root,fvar(12)), 4
;damage = ceil(ifElse((root,fvar(11)) * 35 < 7, 7, (root,fvar(11)) * 35)), 4
damage = ceil(ifElse((root,fvar(11)) * 35 < 10, 10, (root,fvar(11)) * 35)), 4
getpower = 0,0
givepower = 35,35
pausetime = 4*(var(2)<5),6
animtype = Back
air.animtype = Back
fall.animtype = Back
ground.type = High
air.type = Low
ground.hittime = 16
ground.slidetime = 16
guard.hittime = 16
air.hittime = 13
airguard.ctrltime = 16
ground.velocity= -6,-4
guard.velocity = -9
air.velocity = -5.5,-3.9
airguard.velocity = -5.5, -1.5 
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
yaccel = .5
fall=1
air.fall = 1
fall.recover = 0
fall.recovertime = 13
sparkno = -1
hitsound   = s2400,11
guardsound = S6,1
envshake.time = 16
envshake.ampl = 6
envshake.freq = 100
forcestand = 1
palfx.sinadd=64,64,64,4
palfx.mul=128,128,128
palfx.time=32
p1sprpriority = 5

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = movecontact 
var(18) = 0

[State 1315, Sparks]
type=explod
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
anim=7020
sprpriority=3
postype=p2
pos=(target,const(size.ground.front)-10),-floor(p2dist y)
removetime=-2
ownpal=1
facing=-1
ignorehitpause=1
persistent=0
pausemovetime=100
supermovetime=100

[State 3005, end]
type = changestate
trigger1 = movecontact
value = 2002

[State 3001, Guardshake]
type = envshake
trigger1 = movecontact=1 && numtarget
time = 4
ampl = 6
freq = 176
ignorehitpause = 1

[State 1061, End]
type = destroyself
trigger1 = pos x!=[-240,240]

;==========================================================
; CHOU GALICK HO HELPER

[Statedef 2401]
type = A
physics = N
movetype = A
ctrl = 0
sprpriority = 20

[State 3005, anim]
type = changeanim
trigger1 = !time
value = 2001
elem = random%4

;[State 1061, NoJuggle]
;type = parentvarset
;trigger1 = time = 0
;var(18) = 1

[State 3005, hitvar]
type=varadd
trigger1= !time
var(2)=1

[State 13100, goes SND]
type = playsnd
trigger1 =  !time
value = 2000,6
channel = 6

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 1061, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

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

[State 1061, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 1061, HitOverride]
type = HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 2002
attr = SCA, NP, SP, HP
ignorehitpause = 1

[State 1061, Velocity]
type = VelSet
trigger1 = 1
x = ifelse((time<2 && var(2)>1),1,10)

[State 3005, hit]
type = hitdef
trigger1 = 1
attr = S,HP
hitflag = MAF
guardflag = MA
priority = 7,Hit
;damage = ceil(26*root,fvar(12)), 4
;damage = ceil(ifElse((root,fvar(11)) * 20 < 7, 7, (root,fvar(11)) * 20)), 4
damage = ceil(ifElse((root,fvar(11)) * 20 < 4, 4, (root,fvar(11)) * 20)), 4
getpower = 0,0
givepower = 20,20
pausetime = 3,6
animtype = Back
air.animtype = Back
fall.animtype = Back
ground.type = High
air.type = Low
ground.hittime = 16
ground.slidetime = 16
guard.hittime = 16
air.hittime = 13
airguard.ctrltime = 16
ground.velocity= -2,0
guard.velocity = -9
air.velocity = -5.5,-3.9
airguard.velocity = -5.5, -1.5 
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
yaccel = .5
fall=0
air.fall = 1
fall.recover = 0
fall.recovertime = 13
sparkno = -1
hitsound   = s2400,11
guardsound = S6,1
envshake.time = 16
envshake.ampl = 6
envshake.freq = 100
forcestand = 1
palfx.sinadd=64,64,64,4
palfx.mul=128,128,128
palfx.time=32
p1sprpriority = 5

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

;[State 1061, NoJuggle]
;type = parentvarset
;trigger1 = movecontact 
;var(18) = 0

[State 1315, Sparks]
type=explod
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
anim=7020
sprpriority=3
postype=p2
pos=(target,const(size.ground.front)-10),-floor(p2dist y)
removetime=-2
ownpal=1
facing=-1
ignorehitpause=1
persistent=0
pausemovetime=100
supermovetime=100

[State 3005, end]
type = changestate
trigger1 = movecontact
value = 2002

[State 3001, Guardshake]
type = envshake
trigger1 = movecontact=1 && numtarget
time = 4
ampl = 6
freq = 176
ignorehitpause = 1

[State 1061, End]
type = destroyself
trigger1 = pos x!=[-300,300]

;--------------------------------------
; CHOU GALICK HO HELPER LAST

[Statedef 2403]
type = A
physics = N
movetype = A
ctrl = 0
sprpriority = 5

[State 3005, anim]
type = changeanim
trigger1 = !time && !prevstateno
value = 2001

[State 1061, NoJuggle]
type = parentvarset
trigger1 = time = 0
var(18) = 1

[State 3005, hitvar]
type=varadd
trigger1= !time
var(2)=1

[State 1055, movehitvar]
type=varset
trigger1= movecontact && numtarget
trigger1= !(target,ishelper)
var(3)=1
ignorehitpause=1

[State 13100, goes SND]
type = playsnd
trigger1 =  !time
value = 2000,6

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 1061, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

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

[State 1061, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 1061, HitOverride]
type = HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 2002
attr = SCA, NP, SP, HP
ignorehitpause = 1

[State 1061, Velocity]
type = VelSet
trigger1 = 1
x = ifelse((time<2 && var(2)>1),1,10)

[State 3005, hit]
type = hitdef
trigger1 = 1
attr = S,HP
hitflag = MAF
guardflag = MA
priority = 7,Hit
;damage = ceil(26*root,fvar(12)), 4
;damage = ceil(ifElse((root,fvar(11)) * 20 < 7, 7, (root,fvar(11)) * 20)), 4
damage = ceil(ifElse((root,fvar(11)) * 20 < 4, 4, (root,fvar(11)) * 20)), 4
getpower = 0,0
givepower = 20,20
pausetime = 4,6
animtype = Back
air.animtype = Back
fall.animtype = Back
ground.type = High
air.type = Low
ground.hittime = 16
ground.slidetime = 16
guard.hittime = 16
air.hittime = 13
airguard.ctrltime = 16
ground.velocity= -6,-3
guard.velocity = -9
air.velocity = -5.5,-3.9
airguard.velocity = -5.5, -1.5 
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
yaccel = .5
fall=1
air.fall = 1
fall.recover = 0
fall.recovertime = 13
sparkno = -1
hitsound   = s2400,11
guardsound = S6,1
envshake.time = 16
envshake.ampl = 6
envshake.freq = 100
forcestand = 1
palfx.sinadd=64,64,64,4
palfx.mul=128,128,128
palfx.time=32
p1sprpriority = 5

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = movecontact 
var(18) = 0

[State 1315, Sparks]
type=explod
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
anim=7020
sprpriority=3
postype=p2
pos=(target,const(size.ground.front)-10),-floor(p2dist y)
removetime=-2
ownpal=1
facing=-1
ignorehitpause=1
persistent=0
pausemovetime=100
supermovetime=100

[State 3005, end]
type = changestate
trigger1 = movecontact
value = 2002

[State 3001, Guardshake]
type = envshake
trigger1 = movecontact=1 && numtarget
time = 4
ampl = 6
freq = 176
ignorehitpause = 1

[State 1061, End]
type = destroyself
trigger1 = pos x!=[-300,300]


;==========================================================
; VERTICAL (DOWN) GALICK HO HELPER

[Statedef 2102]
type = A
physics = N
movetype = A
ctrl = 0
sprpriority = 5

[State 3005, anim]
type = changeanim
trigger1 = !time && !prevstateno
value = 2102
elem = random%4

[State 1061, Turn]
type = AngleDraw
trigger1 = 1
value = -90
ignorehitpause=1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = time = 0
var(18) = 1

[State 3005, hitvar]
type=varadd
trigger1= !time
var(2)=1

[State 1055, movehitvar]
type=varset
trigger1= movecontact && numtarget
trigger1= !(target,ishelper)
var(3)=1
ignorehitpause=1

[State 13100, goes SND]
type = playsnd
trigger1 =  !time
value = 2000,6

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 1061, transparency]
type = Trans
trigger1 = root,var(2)=1
trans = addalpha
alpha = 200,128

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

[State 1061, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 1061, HitOverride]
type = HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 2110
attr = SCA, NP, SP, HP
ignorehitpause = 1

[State 1061, Velocity]
type = VelSet
trigger1 = 1
y = ifelse((time<2 && var(2)>1),1,10)

[State 3005, hit]
type = hitdef
trigger1 = 1
attr = S,HP
hitflag = MAFD
guardflag = MA
priority = 7,Hit
;damage = ceil(35*root,fvar(12)), 4
;damage = ceil(ifElse((root,fvar(11)) * 35 < 7, 7, (root,fvar(11)) * 35)), 4
damage = ceil(ifElse((root,fvar(11)) * 35 < 10, 10, (root,fvar(11)) * 35)), 4
getpower = 0,0
givepower = 35,35
pausetime = 4,6
animtype = Back
air.animtype = Back
fall.animtype = Back
ground.type = High
air.type = Low
ground.hittime = 16
ground.slidetime = 16
guard.hittime = 16
air.hittime = 13
airguard.ctrltime = 16
ground.velocity= 0,0
guard.velocity = -1
air.velocity = -1.5,-5.9
airguard.velocity = -1.5, -5.5 
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
yaccel = .5
fall=0
air.fall = 1
fall.recover = 0
fall.recovertime = 13
sparkno = -1
hitsound   = s2400,11
guardsound = S6,1
envshake.time = 16
envshake.ampl = 6
envshake.freq = 100
forcestand = 1
palfx.sinadd=64,64,64,4
palfx.mul=128,128,128
palfx.time=32
p1sprpriority = 5

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = movecontact 
var(18) = 0

[State 1315, Sparks]
type=explod
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
anim=7020
sprpriority=3
postype=p2
pos=(target,const(size.ground.front)-10),-floor(p2dist y)
removetime=-2
ownpal=1
facing=-1
ignorehitpause=1
persistent=0
pausemovetime=100
supermovetime=100

[State 3001, Guardshake]
type = envshake
trigger1 = movecontact=1 && numtarget
time = 4
ampl = 6
freq = 176
ignorehitpause = 1

[State 1061, End]
type = destroyself
trigger1 = (pos y!=[-10000,240])
trigger2 = time>180

[State 3055, end]
type = PlaySnd
trigger1 = pos y >= 0
value = s1000,0
persistent = 0

[State 1061, Fade]
type = changestate
trigger1 = movecontact
trigger2 = pos Y >= 0
value = 2110
ignorehitpause=1

;-----------------------------------------
; Aerial vertical Galick Ho explod/vanish
[Statedef 2110]
type=A
physics=N
movetype=I
velset=0,-1
ctrl=0
sprpriority=5
hitcountpersist = 1

[State 1308, nothitby]
type = nothitby
trigger1 = 1
time = 1
value = SCA
ignorehitpause = 1

[State 3005, anim]
type = changeanim
trigger1 = !time
value = 2006
ignorehitpause=1

[State 1061, Turn]
type = AngleDraw
trigger1 = 1
value = -90
ignorehitpause=1

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 1061, transparency]
type = Trans
trigger1 = root,var(2)=1
trans = addalpha
alpha = 200,128

[State 1316, End]
type=destroyself
trigger1= !animtime
[State 1316, End with Zzyzzyxx fix]
type= null ;destroyself
trigger1 = !numtarget
trigger2 = numtarget
trigger2 = target, time <= 1 && !(target, hitshakeover)

;==========================================================
; VERTICAL (DOWN) GALICK HO HELPER LAST

[Statedef 2105]
type = A
physics = N
movetype = A
ctrl = 0
sprpriority = 5

[State 3005, anim]
type = changeanim
trigger1 = !time && !prevstateno
value = 2102

[State 1061, NoJuggle]
type = parentvarset
trigger1 = time = 0
var(18) = 1

[State 1061, Turn]
type = AngleDraw
trigger1 = 1
value = -90

[State 3005, hitvar]
type=varadd
trigger1= !time
var(2)=1

[State 1055, movehitvar]
type=varset
trigger1= movecontact && numtarget
trigger1= !(target,ishelper)
var(3)=1
ignorehitpause=1

[State 13100, goes SND]
type = playsnd
trigger1 =  !time
value = 2000,6

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 1061, transparency]
type = Trans
trigger1 = root,var(2)=1
trans = addalpha
alpha = 200,128

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

[State 1061, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 1061, HitOverride]
type = HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 2110
attr = SCA, NP, SP, HP
ignorehitpause = 1

[State 1061, Velocity]
type = VelSet
trigger1 = 1
y = ifelse((time<2 && var(2)>1),1,10)

[State 3005, hit]
type = hitdef
trigger1 = 1
attr = S,HP
hitflag = MAFD
guardflag = MA
priority = 7,Hit
;damage = ceil(35*root,fvar(12)), 4
;damage = ceil(ifElse((root,fvar(11)) * 35 < 7, 7, (root,fvar(11)) * 35)), 4
damage = ceil(ifElse((root,fvar(11)) * 35 < 10, 10, (root,fvar(11)) * 35)), 4
getpower = 0,0
givepower = 35,35
pausetime = 4,6
animtype = Back
air.animtype = Back
fall.animtype = Back
ground.type = High
air.type = Low
ground.hittime = 16
ground.slidetime = 16
guard.hittime = 16
air.hittime = 13
airguard.ctrltime = 16
ground.velocity= -1,5
guard.velocity = -5
air.velocity = -1,5.9
airguard.velocity = -1, 1.5 
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
yaccel = .5
fall=1
air.fall = 1
fall.recover = 0
fall.recovertime = 13
sparkno = -1
hitsound   = s2400,11
guardsound = S6,1
envshake.time = 16
envshake.ampl = 6
envshake.freq = 100
forcestand = 1
palfx.sinadd=64,64,64,4
palfx.mul=128,128,128
palfx.time=32
p1sprpriority = 5

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = movecontact 
var(18) = 0

[State 1315, Sparks]
type=explod
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
anim=7020
sprpriority=3
postype=p2
pos=(target,const(size.ground.front)-10),-floor(p2dist y)
removetime=-2
ownpal=1
facing=-1
ignorehitpause=1
persistent=0
pausemovetime=100
supermovetime=100

[State 3001, Guardshake]
type = envshake
trigger1 = movecontact=1 && numtarget
time = 4
ampl = 6
freq = 176
ignorehitpause = 1

[State 1061, End]
type = destroyself
trigger1 = (pos y!=[-10000,240])
trigger2 = time>180

[State 3055, end]
type = PlaySnd
trigger1 = pos y >= 0
value = s1000,0
persistent = 0

[State 1061, Fade]
type = changestate
trigger1 = movecontact
trigger2 = pos Y >= 0
value = 2110
ignorehitpause=1


;==========================================================
; VERTICAL (DOWN) CHOU GALICK HO HELPER

[Statedef 2452]
type = A
physics = N
movetype = A
ctrl = 0
sprpriority = 5

[State 3005, anim]
type = changeanim
trigger1 = !time && !prevstateno
value = 2102
elem = random%4

[State 1061, Turn]
type = AngleDraw
trigger1 = 1
value = -90
ignorehitpause=1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = time = 0
var(18) = 1

[State 3005, hitvar]
type=varadd
trigger1= !time
var(2)=1

[State 1055, movehitvar]
type=varset
trigger1= movecontact && numtarget
trigger1= !(target,ishelper)
var(3)=1
ignorehitpause=1

[State 13100, goes SND]
type = playsnd
trigger1 =  !time
value = 2000,6

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 1061, transparency]
type = Trans
trigger1 = root,var(2)=1
trans = addalpha
alpha = 200,128

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

[State 1061, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 1061, HitOverride]
type = HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 2110
attr = SCA, NP, SP, HP
ignorehitpause = 1

[State 1061, Velocity]
type = VelSet
trigger1 = 1
y = ifelse((time<2 && var(2)>1),1,10)

[State 3005, hit]
type = hitdef
trigger1 = 1
attr = S,HP
hitflag = MAFD
guardflag = MA
priority = 7,Hit
;damage = ceil(26*root,fvar(12)), 4
damage = ceil(ifElse((root,fvar(11)) * 17 < 7, 7, (root,fvar(11)) * 17)), 4
;damage = ceil(ifElse((root,fvar(11)) * 17 < 10, 10, (root,fvar(11)) * 17)), 4
getpower = 0,0
givepower = 20,20
pausetime = 3,6
animtype = Back
air.animtype = Back
fall.animtype = Back
ground.type = High
air.type = Low
ground.hittime = 16
ground.slidetime = 16
guard.hittime = 16
air.hittime = 13
airguard.ctrltime = 16
ground.velocity= 0,0
guard.velocity = -1
air.velocity = -1.5,-5.9
airguard.velocity = -1.5, -5.5 
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
yaccel = .5
fall=0
air.fall = 1
fall.recover = 0
fall.recovertime = 13
sparkno = -1
hitsound   = s2400,11
guardsound = S6,1
envshake.time = 16
envshake.ampl = 6
envshake.freq = 100
forcestand = 1
palfx.sinadd=64,64,64,4
palfx.mul=128,128,128
palfx.time=32
p1sprpriority = 5

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = movecontact 
var(18) = 0

[State 1315, Sparks]
type=explod
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
anim=7020
sprpriority=3
postype=p2
pos=(target,const(size.ground.front)-10),-floor(p2dist y)
removetime=-2
ownpal=1
facing=-1
ignorehitpause=1
persistent=0
pausemovetime=100
supermovetime=100

[State 3001, Guardshake]
type = envshake
trigger1 = movecontact=1 && numtarget
time = 4
ampl = 6
freq = 176
ignorehitpause = 1

[State 1061, End]
type = destroyself
trigger1 = (pos y!=[-10000,240])
trigger2 = time>180

[State 3055, end]
type = PlaySnd
trigger1 = pos y >= 0
value = s1000,0
persistent = 0

[State 1061, Fade]
type = changestate
trigger1 = movecontact
trigger2 = pos Y >= 0
value = 2110
ignorehitpause=1

;==========================================================
; VERTICAL (DOWN) CHOU GALICK HO HELPER LAST

[Statedef 2453]
type = A
physics = N
movetype = A
ctrl = 0
sprpriority = 5

[State 3005, anim]
type = changeanim
trigger1 = !time && !prevstateno
value = 2102

[State 1061, NoJuggle]
type = parentvarset
trigger1 = time = 0
var(18) = 1

[State 1061, Turn]
type = AngleDraw
trigger1 = 1
value = -90
ignorehitpause=1

[State 3005, hitvar]
type=varadd
trigger1= !time
var(2)=1

[State 1055, movehitvar]
type=varset
trigger1= movecontact && numtarget
trigger1= !(target,ishelper)
var(3)=1
ignorehitpause=1

[State 13100, goes SND]
type = playsnd
trigger1 =  !time
value = 2000,6

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 1061, transparency]
type = Trans
trigger1 = root,var(2)=1
trans = addalpha
alpha = 200,128

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

[State 1061, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 1061, HitOverride]
type = HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 2110
attr = SCA, NP, SP, HP
ignorehitpause = 1

[State 1061, Velocity]
type = VelSet
trigger1 = 1
y = ifelse((time<2 && var(2)>1),1,10)

[State 3005, hit]
type = hitdef
trigger1 = 1
attr = S,HP
hitflag = MAFD
guardflag = MA
priority = 7,Hit
;damage = ceil(26*root,fvar(12)), 4
damage = ceil(ifElse((root,fvar(11)) * 17 < 7, 7, (root,fvar(11)) * 17)), 4
;damage = ceil(ifElse((root,fvar(11)) * 17 < 10, 10, (root,fvar(11)) * 17)), 4
getpower = 0,0
givepower = 20,20
pausetime = 4,6
animtype = Back
air.animtype = Back
fall.animtype = Back
ground.type = High
air.type = Low
ground.hittime = 16
ground.slidetime = 16
guard.hittime = 16
air.hittime = 13
airguard.ctrltime = 16
ground.velocity= -1,5
guard.velocity = -5
air.velocity = -1,5.9
airguard.velocity = -1, 1.5 
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
yaccel = .5
fall=1
air.fall = 1
fall.recover = 0
fall.recovertime = 13
sparkno = -1
hitsound   = s2400,11
guardsound = S6,1
envshake.time = 16
envshake.ampl = 6
envshake.freq = 100
forcestand = 1
palfx.sinadd=64,64,64,4
palfx.mul=128,128,128
palfx.time=32
p1sprpriority = 5

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = movecontact 
var(18) = 0

[State 1315, Sparks]
type=explod
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
anim=7020
sprpriority=3
postype=p2
pos=(target,const(size.ground.front)-10),-floor(p2dist y)
removetime=-2
ownpal=1
facing=-1
ignorehitpause=1
persistent=0
pausemovetime=100
supermovetime=100

[State 3001, Guardshake]
type = envshake
trigger1 = movecontact=1 && numtarget
time = 4
ampl = 6
freq = 176
ignorehitpause = 1

[State 1061, End]
type = destroyself
trigger1 = (pos y!=[-10000,240])
trigger2 = time>180

[State 3055, end]
type = PlaySnd
trigger1 = pos y >= 0
value = s1000,0
persistent = 0

[State 1061, Fade]
type = changestate
trigger1 = movecontact
trigger2 = pos Y >= 0
value = 2110
ignorehitpause=1


;------------------------------------------------
; Big Ball Beam Collision

[Statedef 2483]
type    = S
movetype= A
physics = N
anim = 15999
sprpriority = 7

[state 17100,move ball FX]
type = Posset
trigger1 = 1
X = floor(160.0*((root,fvar(20))-.5))*(root,facing)
Y = -47

[State -2, Explod];Big Ball at center
type = Explod
trigger1 = !numexplod(2483) && !time
anim = 2483
removetime = -1
sprpriority = 6
id = 2483
bindtime = -1
ownpal = 1
postype = p1
pos = 0,0
scale = .45,.45
ignorehitpause = 1
pausemovetime = 99999
supermovetime = 99999
facing = root,facing

[State 1305, timevar]
type = varadd
trigger1 = root,stateno != 2489
var(4) = 1

[State 1305, Scale Explod]
type = ModifyExplod
trigger1 = root,stateno = 2489
scale = 0.7+.1*(time-var(4)),0.7+.1*(time-var(4))
ID = 2483

[State 13100, explosion SND]
type = playsnd
trigger1 = root,stateno = 2489
trigger1 = time-var(4) = 0
value = 2483,0
volume = 255

[State 2260, destroy]
type = RemoveExplod
trigger1 = root,stateno != 2481
trigger1 = root,stateno != 2489
ID = 2483

[State 2260, destroy]
type = DestroySelf
trigger1 = root,stateno != 2481
trigger1 = root,stateno != 2489


;===================================================
;FINAL FLASH TRAINEE HELPER

[StateDef 2501] ; AftImg
type = S
movetype = I
physics = N
ctrl = 0

[State 3020, 2]
type = changeanim
triggerall = !time
trigger1 = anim !=2500
trigger1 = anim !=2550
value = 2500+50*(root,statetype=A)
elem = 7

[State 13001, Pos]
type = BindToRoot
trigger1 = time = 0
time = -1
facing = 1
pos = 0,0

[State 13001, NoVis]
type = AssertSpecial
trigger1 = 1
flag = invisible

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

[State 13001, NoHit]
type = NotHitBy
trigger1 = 1
value = SCA

[State 13001, Aftimg]
type = AfterImage
trigger1 = Time = 0
time = 900
palbright = 0,-50,-50
palcontrast = 256,256,256
paladd = 100,-50,-50
;color = 0
trans = add1

[State 13001, EndImg]
type = AfterImageTime
trigger1 = Root, Stateno != 2500
trigger1 = Root, Stateno != 2550
time = 1

[State 13001, End]
type = DestroySelf
trigger1 = Root, StateNo != 2500
trigger1 = Root, Stateno != 2550

;===================================================
;FINAL FLASH BEAM

[Statedef 2504]
type = A
physics = N
movetype = A
ctrl = 0
sprpriority = 5

[State 1061, NoJuggle]
type = parentvarset
trigger1 = time = 0
var(18) = 1

[State 1061, Bind]
type = bindtoroot
trigger1 = 1
pos = 20, -80
ignorehitpause = 1

[State 8000, Assert]
type=assertspecial
trigger1= 1
flag=noshadow
ignorehitpause = 1

[State 3005, hitvar]
type=varadd
trigger1= !time
var(2)=1

[State 1061, Transparency]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 3005, anim]
type = changeanim
trigger1 = !time && !prevstateno && !movecontact
value = 2504

[State 3005, anim]
type = AngleDraw
trigger1 = 1
scale = 1.5,1

[State 3005, hit]
type = hitdef
trigger1 = var(2)<10
attr = S,HP
hitflag = MAF
guardflag = MA
priority = 7,Hit
;damage = ceil(13*root,fvar(12)), 3
;damage = ceil(ifElse((root,fvar(11)) * 13 < 7, 7, (root,fvar(11)) * 13)), 3
damage = ceil(ifElse((root,fvar(11)) * 13 < 3, 3, (root,fvar(11)) * 13)), 3
getpower = 0,0
givepower = 20,20
pausetime = 2*(var(2)<50),6
animtype = Back
air.animtype = Back
fall.animtype = Back
ground.type = High
air.type = Low
ground.hittime = 16
ground.slidetime = 16
guard.hittime = 16
air.hittime = 13
airguard.ctrltime = 16
ground.velocity= ifelse(var(2)<50, -2, -10), ifelse(var(2)<50, 0, -3)
guard.velocity = -9
air.velocity = -5.5,-3.9
airguard.velocity = -5.5, -1.5 
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
yaccel = .5
fall=(var(2)>=50)
air.fall = 1
fall.recover = 0
fall.recovertime = 13
sparkno = -1
;hitsound   = s1000,0
guardsound = S6,1
envshake.time = 16
envshake.ampl = 6
envshake.freq = 100
forcestand = 1
palfx.sinadd=64,64,64,4
palfx.mul=128,128,128
palfx.time=32
p1sprpriority = 5
kill = 0
getpower = 0,0

[State 3005, hit]
type = hitdef
trigger1 = var(2)>=10
attr = S,HP
hitflag = MAF
guardflag = MA
priority = 7,Hit
;damage = ceil(12*root,fvar(12)), 2
;damage = ceil(ifElse((root,fvar(11)) * 12 < 7, 7, (root,fvar(11)) * 12)), 2
damage = ceil(ifElse((root,fvar(11)) * 12 < 5, 5, (root,fvar(11)) * 12)), 2
getpower = 0,0
givepower = 20,20
pausetime = 3*(var(2)<50),6
animtype = Back
air.animtype = Back
fall.animtype = Back
ground.type = High
air.type = Low
ground.hittime = 16
ground.slidetime = 16
guard.hittime = 16
air.hittime = 13
airguard.ctrltime = 16
ground.velocity= ifelse(var(2)<50, -2, -10), ifelse(var(2)<50, 0, -3)
guard.velocity = -9
air.velocity = -5.5,-3.9
airguard.velocity = -5.5, -1.5 
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
yaccel = .5
fall=(var(2)>=50)
air.fall = 1
fall.recover = 0
fall.recovertime = 13
sparkno = -1
;hitsound   = s1000,0
guardsound = S6,1
envshake.time = 16
envshake.ampl = 6
envshake.freq = 100
forcestand = 1
palfx.sinadd=64,64,64,4
palfx.mul=128,128,128
palfx.time=32
p1sprpriority = 5
;p1stateno = 2509
;p2stateno = 2511
kill = var(2)>=50
getpower = 0,0

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1


[State 250, 1]
type = PlaySnd
trigger1 = movehit
value = 1410,2 ;1000,0
volume = -200
;persistent = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = movecontact 
var(18) = 0

[State 1315, Sparks]
type=explod
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
anim=7030
sprpriority=6
postype=p2
pos=(target,const(size.ground.front)-10)+(random%20), -floor(p2dist y)+(random%20)-10
removetime=-2
ownpal=1
facing=-1
ignorehitpause=1
pausemovetime=100
supermovetime=100

[State 0, TargetState]  ;new
type = TargetState
triggerall = var(2)<10
trigger1 = movehit = 1
trigger1 = numtarget
trigger1 = !(target, ishelper)
value = 5020
ignorehitpause = 1

[State 0, TargetState]
type = TargetState
triggerall = var(2)>=10
trigger1 = movehit = 1
trigger1 = numtarget
trigger1 = !(target, ishelper)
value = 2511
ignorehitpause = 1

[State 0, ChangeState]
type = ChangeState
triggerall = var(2)>=10
trigger1 = movehit = 1
trigger1 = numtarget
trigger1 = !(target, ishelper)
value = 2509
persistent = 1

[State 3005, end]
type = changestate
trigger1 = movecontact
value = ifelse(var(2)<50,2504,1316)

[State 1061, End]
type = destroyself
trigger1 = root,stateno != 2502

;--------------------------------------------------
;FINAL FLASH BEAM HITTING 2ND PART

[Statedef 2509]
type = A
physics = N
movetype = A
ctrl = 0
sprpriority = 5

[State 1061, Bind]
type = bindtoroot
trigger1 = 1
pos = 30, -90
ignorehitpause = 1

[State 8000, Assert]
type=assertspecial
trigger1= 1
flag=noshadow
ignorehitpause = 1

[State 1061, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 3005, anim]
type = changeanim
trigger1 = !time
value = 2504

[State 0, Wave FX]
type = Explod
trigger1 = time = 0
anim = 2505
id = 2505
pos = 0,0
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = 190
sprpriority = 6
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0

;----- Shaking, hitting, damage, sounds -----
[State 13100, Snd]
type = PlaySnd
trigger1 = Time%8=0 && Time<160
value = 1410,2 ;s1000,0
volume = -200
[State 13100, HitAdd]
type = HitAdd
trigger1 = Time%4=0 && Time<160
value = 1
[State 0, VarAdd]
type = ParentVarAdd
trigger1 = Time%4=0 && Time<160
fvar(13) = 1
[State 13100, Hurt]
type = TargetLifeAdd
trigger1 = Time%4=0 && Time<160
;value = -ceil(12*root,fvar(12))
value = -ceil(ifElse((root,fvar(11)) * 12 < 6, 6, (root,fvar(11)) * 12))
kill = time >= 153
[State 13100, shake]
type = envshake
trigger1 = Time%4=0 && Time<160
time = 12
freq = 80
ampl = 6

[State 3025, p2state - killed burned]
type = targetstate
trigger1 = time= 190
trigger1 = numtarget
trigger1 = WinKO
value = 5944
ignorehitpause = 1

[State 3025, p2state - killed fatality]
type = Null ;targetstate
trigger1 = time= 190
trigger1 = numtarget
trigger1 = MatchOver
trigger1 = WinKO
value = ifelse((target, SelfAnimExist(5941)), 5941, 5943)
ignorehitpause = 1

[State 13100, Scale]
type = AngleDraw
trigger1 = Time = [170,191]
scale = 1, 1-0.05*(time-170)

[State 13100, Scale]
type = ModifyExplod
trigger1 = Time = [170,191]
scale = 1, 1-0.05*(time-170)
ID = 2505

[State 1061, End]
type = destroyself
trigger1 = time=191
trigger2 = root,anim!=2502

;------------------------------------------------
; Horizontal Lines BG

[Statedef 2937]
type = A
movetype = A
physics = N
anim = 15999
velset = 0,0

[State 2260, push]
type = PlayerPush
trigger1 = Time >= 0
value = 0

[State 2260, muteki]
type = NotHitBy
trigger1 = 1
value = SCA

[State 2260, bg]
type = assertspecial
trigger1 = 1
flag = noFG
flag2 = noBG
flag3 = nobardisplay
ignorehitpause = 1

[State 2260, flash]
type = PalFX
trigger1 = TimeMod = 4,0
trigger1 = 1
time = 1
invertall = 1
ignorehitpause = 0

[state 3250, speedlines]
type = explod
trigger1 = time = 0
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 = 0
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 2260, destroy]
type = DestroySelf
trigger1 = time = 224

;====================================
; BAKUHATSUHA FLAME FX
[Statedef 8600]
type = S
velset = 0,0
sprpriority = 0
anim = 15999
ctrl = 0

[State 6050, Explod]
type = Explod
trigger1 = time = 0
anim = 8600
ID = 8600
pos = 5,-55  ;(enemynear,const(size.mid.pos.x))-20,(enemynear,const(size.mid.pos.y))-10
postype = p2
sprpriority = 2
bindtime = -1
ownpal = 1
facing = -1

[State 6050, Explod]
type = Explod
trigger1 = time = 0
anim = 8601
ID = 8600
pos = 15,-20   ;(enemynear,const(size.mid.pos.x))-40,(enemynear,const(size.mid.pos.y))+10
postype = p2
sprpriority = 2
bindtime = -1
ownpal = 1
facing = -1

[State 6050, Explod]
type = Explod
trigger1 = time = 0
anim = 8601
ID = 8600
pos = -15,-30   ;(enemynear,const(size.mid.pos.x))+10,(enemynear,const(size.mid.pos.y))-30
postype = p2
sprpriority = 3
bindtime = -1
ownpal = 1
facing = -1

[State 11000, DestroySelf]
type = DestroySelf
trigger1 = time = 0

;====================================
; Broken Back - BG Arms + legs

[Statedef 245947]
type = S
movetype = H
physics = N
velset = 0,0
anim = 5947

[State 2260, bind]
type = bindtoroot
trigger1 = !ishelper
trigger1 = 1
pos = 0,0

[State 2260, bind]
type = bindtoparent
trigger1 = IsHelper
trigger1 = 1
pos = 0,0

[State 2260, muteki]
type = NotHitBy
trigger1 = 1
value = SCA

[State 2260, destroy]
type = DestroySelf
trigger1 = time = 126

;====================================
; RE Broken Back - BG Arms + legs

[Statedef 355947]
type = S
movetype = H
physics = N
velset = 0,0
anim = 5947

[State 2260, bind]
type = bindtoroot
trigger1 = !ishelper
trigger1 = 1
pos = 0,0

[State 2260, bind]
type = bindtoparent
trigger1 = IsHelper
trigger1 = 1
pos = 0,0

[State 2260, muteki]
type = NotHitBy
trigger1 = 1
value = SCA

[State 2260, destroy]
type = DestroySelf
trigger1 = time = 19


;===================================================
;GALACTIC GUNFIRE TRAINEE HELPER

[StateDef 2607] ; AftImg
type = S
movetype = I
physics = N
ctrl = 0

[State 3020, 2]
type = changeanim
trigger1 = !time && anim !=2600
value = 2600

[State 13001, Pos]
type = BindToRoot
trigger1 = time = 0
time = -1
facing = 1

[State 13001, NoVis]
type = AssertSpecial
trigger1 = 1
flag = invisible

[State 13001, NoHit]
type = NotHitBy
trigger1 = 1
value = SCA

[State 13001, Aftimg]
type = AfterImage
trigger1 = Time = 0
time = 900
palbright = 0,-50,-50
palcontrast = 256,256,256
paladd = 100,-50,-50
;color = 0
trans = add1

[State 13001, EndImg]
type = AfterImageTime
trigger1 = Root, Stateno != 2600
trigger1 = Root, Stateno != 2605
trigger2 = time>=20
time = 1

[State 13001, End]
type = DestroySelf
trigger1 = Root, StateNo != 2600
trigger1 = Root, Stateno != 2605
trigger2 = time>=20

;====================================
;Galactic Gunfire Ki Blast FX
[Statedef 2621]
type    = S
movetype= A
physics = N
anim = 1010
sprpriority = 5
hitcountpersist = 1
movehitpersist = 1

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 1061, Transparency]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 1061, Turn]
type = AngleDraw
trigger1 = 1
value = -90

[State 1061, Velocity]
type = VelSet
trigger1 = Time = 0
y = 11

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

[State 1061, End]
type = destroyself
trigger1 = (pos y!=[-1000,240])
trigger2 = time>120
trigger3 = root,stateno != 2620
trigger3 = root,stateno != 2820

;====================================
;Galactic Gunfire Ki Blast FX - hitting
[Statedef 2630]
type    = S
movetype= A
physics = N
anim = 1010
sprpriority = 5
hitcountpersist = 1
movehitpersist = 1

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 1061, Transparency]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 1061, Turn]
type = AngleDraw
trigger1 = 1
value = -90

[State 1061, Velocity]
type = VelSet
trigger1 = Time = 0
y = 11

[State 1061, End]
type = destroyself
trigger1 = (pos y!=[-1000,240])
trigger2 = time>180

[State 3055, end]
type = PlaySnd
trigger1 = pos y >= -10
value = s1000,0
persistent = 0
[State 13100, explosion sound]
type = playsnd
trigger1 = pos y >= -10
value = 2511,0
volume = 355
persistent = 0

[State 13100, shake]
type = envshake
trigger1 = pos y >= -10
time = 10
freq = 100
ampl = 8

[State 800, scaling explod]
type = VarSet
trigger1 = !time
fvar(1) = 1+0.1*(random%5)

[state 1215, Explosion FX]
type = explod
trigger1 = pos y >= -10
anim = 2512
id = 2512
pos = 0,-3*(random%5)
postype = P1
sprpriority = 6
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 0
bindtime = 1
scale = fvar(1),fvar(1)
facing = ifelse(random>500,1,-1)

[State 13100, HitAdd]
type = HitAdd
trigger1 = pos y >= -10
value = 1

[State 1061, Fade]
type = changestate
trigger1 = abs(p2dist Y) < 5
trigger2 = pos Y >= -10
value = 1630
ignorehitpause=1


;====================================
; Galactic Gunfire - Vertical Lines BG
[Statedef 2623]
type = A
movetype = A
physics = N
anim = 2771
velset = 0,0

[State 2260, push]
type = PlayerPush
trigger1 = Time >= 0
value = 0

[State 2260, muteki]
type = NotHitBy
trigger1 = 1
value = SCA

[State 2260, bg]
type = assertspecial
trigger1 = 1
flag = noFG
flag2 = noBG
flag3 = nobardisplay
ignorehitpause = 1

[State 2260, flash]
type = null ;PalFX
trigger1 = TimeMod = 4,0
trigger1 = 1
time = 1
invertall = 1
ignorehitpause = 0

[state 3250, speedlines]
type = explod
trigger1 = time = 0
anim = 12773
ID = 2773
postype = back
pos = 10,0
bindtime = -1
supermove = 0
sprpriority = -1
ontop = 0
ownpal = 1
facing = 1
ignorehitpause = 1
;pausemovetime = 145
removetime = -1

[state 3250, speedlines2]
type = explod
trigger1 = time = 0
anim = 12773
ID = 2773
postype = back
pos = 240,0
bindtime = -1
supermove = 0
sprpriority = -1
ontop = 0
ownpal = 1
facing = 1
ignorehitpause = 1
;pausemovetime = 145
removetime = -1

[State 2260, destroy explod]
type = RemoveExplod
trigger1 = root,stateno != 2620
trigger1 = root,stateno != 2820
trigger1 = root,stateno != 2830		;Charged Blast
trigger1 = root,stateno != 2866		;Final Galick Ho
ID = 2773

[State 2260, destroy]
type = DestroySelf
trigger1 = root,stateno != 2620
trigger1 = root,stateno != 2820
trigger1 = root,stateno != 2830		;Charged Blast
trigger1 = root,stateno != 2866		;Final Galick Ho

;==========================================================
; RAGE GAUGE HELPER P1

[Statedef 2750]
physics = N
velset = 0, 0
sprpriority = 7
anim = 15999

[State 3033, Assert]
type = assertspecial
trigger1 = 1
flag = invisible
ignorehitpause = 1

;2750 = frame
;2751 = full rage (orange)
;27510 = full buffer (blue)
;2752 = grey
;27520 = grey kanji
;2753 = yellow kanji
;2754 = orange kanji
;2755 = red kanji
;2756, 0-5 = flames
;2757,2758,2759 = fades

[State -2, Explod];Grey bar
type = null;Explod
trigger1 = !NumExplod(2752) && (root,var(53))>0
anim = 2752
pos = 76+(root,var(45)),230-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 7
id = 2752
bindtime = -1
;ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

[State -2, Explod];full bar blue (buffer)
type = Explod
trigger1 = !NumExplod(27510) && (root,var(53))>0
anim = 27510
pos = 76+(root,var(45)),230-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 5
id = 27510
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

[State -2, Explod];Scale full bar blue (buffer)
type = ModifyExplod
trigger1 = NumExplod(27510) && (root,var(53))>0
scale = 0.5*(root,var(53))/1000.0,0.5
id = 27510

[State -2, Explod];Empty bar rage (orange)
type = Explod
trigger1 = !NumExplod(2751) && (root,var(53))>0
anim = 2751
pos = 76+(root,var(45)),230-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 5
id = 2751
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

[State -2, Explod];Scale full bar blue
type = ModifyExplod
trigger1 = NumExplod(2751) && (root,var(53))>0
;scale = 0.5*(root,var(53))/1000.0,0.5
scale = 0.5*ifelse(root,var(58)<700, (root,var(58))/700.0, ifelse(root,var(58)>=1400, (root,var(58)-1400)/700.0, (root,var(58)-700)/700.0)),0.5
id = 2751

[State -2, Explod];Frame
type = Explod
trigger1 = !NumExplod(2750) && (root,var(53))>0
anim = 2750
pos = 76+(root,var(45)),230-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 5
id = 2750
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

[State -2, Explod];Grey Kanji
type = Explod
trigger1 = !NumExplod(27520) && (root,var(53))>0
anim = 27520
pos = 76+(root,var(45)),228-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 10
id = 27520
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

[State -2, Explod];Yellow Kanji
type = Explod
trigger1 = !NumExplod(2753) && (root,var(53))>0
trigger1 = (root,var(58))>=700 && (root,var(58))<1400
anim = 2753
pos = 76+(root,var(45)),228-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 10
id = 2753
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

[State -2, Explod];Orange Kanji
type = Explod
trigger1 = !NumExplod(2754) && (root,var(53))>0
trigger1 = (root,var(58))>=1400 && (root,var(58))<2100
anim = 2754
pos = 76+(root,var(45)),228-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 10
id = 2754
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

[State -2, Explod];Red Kanji
type = Explod
trigger1 = !NumExplod(2755) && (root,var(53))>0
trigger1 = (root,var(58))>=2100
anim = 2755
pos = 76+(root,var(45)),228-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 10
id = 2755
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

[State -2, Explod];Flames
type = Explod
trigger1 = !NumExplod(2756) && (root,var(53))>0
trigger1 = (root,var(58))>=2100
anim = 2756
pos = 76+(root,var(45)),228-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 11
id = 2756
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

;Hope Gauge
[state 17100,remove FX]
type = removeexplod
trigger1 = (root,var(53))<=0
id = 2750
[state 17100,remove FX]
type = removeexplod
trigger1 = (root,var(53))<=0
id = 2751
[state 17100,remove FX]
type = removeexplod
trigger1 = (root,var(53))<=0
id = 27510
[state 17100,remove FX]
type = removeexplod
trigger1 = (root,var(53))<=0
id = 2752
[state 17100,remove FX]
type = removeexplod
trigger1 = (root,var(53))<=0 || (root,var(58))>=700
id = 27520
[state 17100,remove FX]
type = removeexplod
trigger1 = (root,var(53))<=0 || (root,var(58))<700 || (root,var(58))>=1400
id = 2753
[state 17100,remove FX]
type = removeexplod
trigger1 = (root,var(53))<=0 || (root,var(58))<1400 || (root,var(58))>=2100
id = 2754
[state 17100,remove FX]
type = removeexplod
trigger1 = (root,var(53))<=0 || (root,var(58))<2100
id = 2755
[state 17100,remove FX]
type = removeexplod
trigger1 = (root,var(53))<=0 || (root,var(58))<2100
id = 2756

[State -2, Explod];Grey bar fades
type = Explod
trigger1 = !NumExplod(2758) && (root,var(53))<=0
anim = 2758
pos = 76+(root,var(45)),228-(root,var(46))
postype = left
removetime = 14
supermove = 1
scale = 0.5,0.5
sprpriority = 0
id = 2758
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999
persistent = 0

[State -2, Explod];Rage Gauge fades
type = Explod
trigger1 = !NumExplod(2759) && (root,var(53))<=0
anim = 2759
pos = 76+(root,var(45)),228-(root,var(46))
postype = left
removetime = 14
supermove = 1
scale = 0.5,0.5
sprpriority = 7
id = 2759
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999
persistent = 0

[State -2, Explod];Yellow Kanji fades
type = Explod
trigger1 = !NumExplod(2757) && (root,var(53))<=0
anim = 2757
pos = 76+(root,var(45)),228-(root,var(46))
postype = left
removetime = 14
supermove = 1
scale = 0.5,0.5
sprpriority = 8
id = 2757
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999
persistent = 0

[State 3033, End]
type = destroyself
trigger1 = (root,var(53))<=0 && !numexplod(2759)

;==========================================================
; RAGE GAUGE HELPER P2

[Statedef 2760]
physics = N
velset = 0, 0
sprpriority = 7
anim = 15999

[State 3033, Assert]
type = assertspecial
trigger1 = 1
flag = invisible
ignorehitpause = 1

;2760 = frame
;2761 = full blue
;27610 = full orange
;2762 = grey
;27620 = black kanji
;2753 = yellow kanji
;2754 = orange kanji
;2755 = red kanji
;2756, 0-5 = flames
;2767,2768,2769 = fades

[State -2, Explod];Grey bar
type = null ;Explod
trigger1 = !NumExplod(2762) && (root,var(53))>0
anim = 2762
pos = 243-(root,var(45)),230-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 7
id = 2762
bindtime = -1
;ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

[State -2, Explod];full bar blue (buffer)
type = Explod
trigger1 = !NumExplod(27610) && (root,var(53))>0
anim = 27610
pos = 243-(root,var(45)),230-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 5
id = 27610
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

[State -2, Explod];Scale full bar
type = ModifyExplod
trigger1 = NumExplod(27610) && (root,var(53))>0
scale = 0.5*(root,var(53))/1000.0,0.5
id = 27610

[State -2, Explod];Empty bar rage (orange)
type = Explod
trigger1 = !NumExplod(2761) && (root,var(53))>0
anim = 2761
pos = 243-(root,var(45)),230-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 5
id = 2761
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

[State -2, Explod];Scale full bar orange
type = ModifyExplod
trigger1 = NumExplod(2761) && (root,var(53))>0
scale = 0.5*ifelse(root,var(58)<700, (root,var(58))/700.0, ifelse(root,var(58)>=1400, (root,var(58)-1400)/700.0, (root,var(58)-700)/700.0)),0.5
id = 2761

[State -2, Explod];Frame
type = Explod
trigger1 = !NumExplod(2760) && (root,var(53))>0
anim = 2760
pos = 242-(root,var(45)),230-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 5
id = 2760
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

[State -2, Explod];Grey Kanji
type = Explod
trigger1 = !NumExplod(27520) && (root,var(53))>0
anim = 27520
pos = 221-(root,var(45)),228-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 10
id = 27520
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

[State -2, Explod];Yellow Kanji
type = Explod
trigger1 = !NumExplod(2753) && (root,var(53))>0
trigger1 = (root,var(58))>=700 && (root,var(58))<1400
anim = 2753
pos = 221-(root,var(45)),228-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 10
id = 2753
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

[State -2, Explod];Orange Kanji
type = Explod
trigger1 = !NumExplod(2754) && (root,var(53))>0
trigger1 = (root,var(58))>=1400 && (root,var(58))<2100
anim = 2754
pos = 221-(root,var(45)),228-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 10
id = 2754
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

[State -2, Explod];Red Kanji
type = Explod
trigger1 = !NumExplod(2755) && (root,var(53))>0
trigger1 = (root,var(58))>=2100
anim = 2755
pos = 221-(root,var(45)),228-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 10
id = 2755
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

[State -2, Explod];Flames
type = Explod
trigger1 = !NumExplod(2756) && (root,var(53))>0
trigger1 = (root,var(58))>=2100
anim = 2756
pos = 221-(root,var(45)),228-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 11
id = 2756
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

;Hope Gauge
[state 17100,remove FX]
type = removeexplod
trigger1 = (root,var(53))<=0
id = 2760
[state 17100,remove FX]
type = removeexplod
trigger1 = (root,var(53))<=0
id = 2761
[state 17100,remove FX]
type = removeexplod
trigger1 = (root,var(53))<=0
id = 27610
[state 17100,remove FX]
type = removeexplod
trigger1 = (root,var(53))<=0 || (root,var(58))>=700
id = 27520
[state 17100,remove FX]
type = removeexplod
trigger1 = (root,var(53))<=0
id = 2762
[state 17100,remove FX]
type = removeexplod
trigger1 = (root,var(53))<=0 || (root,var(58))<700 || (root,var(58))>=1400
id = 2753
[state 17100,remove FX]
type = removeexplod
trigger1 = (root,var(53))<=0 || (root,var(58))<1400 || (root,var(58))>=2100
id = 2754
[state 17100,remove FX]
type = removeexplod
trigger1 = (root,var(53))<=0 || (root,var(58))<2100
id = 2755
[state 17100,remove FX]
type = removeexplod
trigger1 = (root,var(53))<=0 || (root,var(58))<2100
id = 2756

[State -2, Explod];Grey bar fades
type = Explod
trigger1 = !NumExplod(2768) && (root,var(53))<=0
anim = 2768
pos = 242-(root,var(45)),228-(root,var(46))
postype = left
removetime = 14
supermove = 1
scale = 0.5,0.5
sprpriority = 0
id = 2768
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999
persistent = 0

[State -2, Explod];Rage Gauge fades
type = Explod
trigger1 = !NumExplod(2769) && (root,var(53))<=0
anim = 2769
pos = 242-(root,var(45)),228-(root,var(46))
postype = left
removetime = 14
supermove = 1
scale = 0.5,0.5
sprpriority = 7
id = 2769
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999
persistent = 0

[State -2, Explod];Yellow Kanji fades
type = Explod
trigger1 = !NumExplod(2767) && (root,var(53))<=0
anim = 2767
pos = 221-(root,var(45)),228-(root,var(46))
postype = left
removetime = 14
supermove = 1
scale = 0.5,0.5
sprpriority = 8
id = 2767
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999
persistent = 0

[State 3033, End]
type = destroyself
trigger1 = (root,var(53))<=0 && !numexplod(2769)

;======================================================================
;KILLED BY FINAL FLASH, BURNED, SMOKE HELPER
[Statedef 5945]
type = A
movetype = I
physics = N
anim = 15999
sprpriority = 3
velset = 0,0

[State 0, posset]
type = posset
trigger1 = ishelper(5945)
trigger1 = playeridexist(root,var(28))
x = playerid(root,var(28)),pos x
y = playerid(root,var(28)),pos y-20
ignorehitpause = 1
 
[State 0, posset]
type = posset
trigger1 = ishelper(59450)
trigger1 = playeridexist(root,var(29))
x = playerid(root,var(29)),pos x
y = playerid(root,var(29)),pos y-20
ignorehitpause = 1

[state 1315]
type = varset
triggerall = numenemy
trigger1 = !time
fvar(1) = abs(enemy,const(size.head.pos.y)/65.0)

[state 17100, big smoke]
type = explod
trigger1 = (time%20)=0
anim = 5930
id = 5930
pos = ceil(10*fvar(1)),-20
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2

[state 17100, big smoke]
type = explod
trigger1 = (time%20)=6
anim = 5930
id = 5930
pos = ceil(-30*fvar(1)),-10
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2

[state 17100, big smoke]
type = explod
trigger1 = (time%20)=3
anim = 5930
id = 5930
pos = ceil(47*fvar(1)),-5
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2

[state 17100, small smoke]
type = explod
trigger1 = (time%20)=8
anim = 5931
id = 5931
pos = ceil(-10*fvar(1)),-25
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2

[state 17100, small smoke]
type = explod
trigger1 = (time%20)=12
anim = 5931
id = 5931
pos = ceil(32*fvar(1)),-15
postype = P1
sprpriority = -3
ownpal = 1
removetime = -2

[state 17100, small smoke]
type = explod
trigger1 = (time%20)=16
anim = 5931
id = 5931
pos = ceil(0*fvar(1)),-5
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2

[state 17100, small smoke]
type = explod
trigger1 = (time%20)=3
anim = 5931
id = 5931
pos = ceil(25*fvar(1)),-25
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2

;======================================================================
;BIKE HELPER

[Statedef 7722]
type    = S
movetype= I
physics = N
anim = 15999

[state 17100, Bike before destroyed]
type = explod
trigger1 = !time
anim = 721
id = 721
pos = 0,0
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
persistent = 0
scale = 1,1
shadow = -1;,0,0
bindtime = -1

[state 1215, Explosion FX]
type = explod
trigger1 = root,animelemtime(7)=0
anim = 2512
id = 2512
pos = 20,-60
postype = P1
sprpriority = 6
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 0
bindtime = -1

[state 1215, Explosion FX]
type = explod
trigger1 = root,animelemtime(7)=0
anim = 2512
id = 2512
pos = -35,-20
postype = P1
sprpriority = 6
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 0
bindtime = -1

[State 1000, Helper]
type = Helper
trigger1 = root,animelemtime(10)>=0 && numhelper(7723)<12 && numhelper(7724)<12
helpertype = Normal
name = "GlassEffect"
id = 7723
pos = ceil(30-random/11.0),-80+ceil(random/50)
postype = p1
facing = 1
stateno = 7723
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999

[State 1003, DestroySelf]
type = DestroySelf
trigger1 = root,stateno!=707 ;713;720

;-------------------------------
;Pieces Generator

[Statedef 7723]
type = A
movetype = I
physics = N
anim = 15999

[State 1003, Helper]
type = Helper
trigger1 = !time
helpertype = Normal
name = "GlassEffect"
id = 7724
pos = 0,0
postype = p1
facing = 1
stateno = 7724
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1

[State 1003, DestroySelf]
type = DestroySelf
trigger1 = time=2
;-----------
[Statedef 7724]
type = A
movetype = I
physics = N
anim = 72200 + numhelper(7724) - 1 				;Each anim appears once
velset = 3-0.5*(random%13) , -3-0.3*(random%8)	;at various vels
sprpriority = 3

[State 1005, VarRandom]
type = VarSet
trigger1 = !time
fvar(20) = random%2

[State 1004, assert]
type = angledraw
trigger1 = 1
value = ifelse(fvar(20)=1,10*time,-10*time)

[State 1004, assert]
type = assertspecial
trigger1 = 1
flag = noshadow

[State 1405, No hits]
type = NotHitBy
trigger1 = 1
value = SCA

[State 1416, Gravity]
type = Gravity
trigger1 = 1

[State 1415, Hit Floor]
type = ChangeState
trigger1 = Pos Y >= 0
value = 72400
;-----------
;Touches the floor
[Statedef 72400]
type = A
movetype = A
physics = N
velset = ifelse(vel X>0,1,-1),  -2-(random%4)
sprpriority = 3

[State 1011, Override]
type = NotHitBy
trigger1 = 1
value = SCA

[State 1004, assert]
type = angledraw
trigger1 = 1 ;anim!=72200 && anim!=72201
value = ifelse(vel X>0,10*time,-10*time)

[State 1416, Reset Pos]
type = PosSet
trigger1 = !Time
Y = 0

[State 1406, Gravity]
type = Gravity
trigger1 = 1

[State 1406, No Shadow]
type = null; AssertSpecial
trigger1 = 1
flag = noshadow

[State 1415, Hit Floor]
type = ChangeState
trigger1 = (Pos Y >= 0) && time>1
value = 72401
;-----------
;Touches the floor
[Statedef 72401]
type = A
movetype = A
physics = N
sprpriority = 3

[State 1011, loop var]
type = Varadd
trigger1 = !time
var(58) = 1

[State 1011, time var]
type = Varadd
trigger1 = var(58)<3
var(12) = 1

[State 1011, Override]
type = NotHitBy
trigger1 = 1
value = SCA

[State 1011, vels]
type = Velset
trigger1 = !time && var(58)<3
Y = -3-(random%3)+var(58)

[State 1011, vels]
type = Velmul
trigger1 = 1
x = 0.98

[State 1004, assert]
type = angledraw
trigger1 = anim!=72200 && anim!=72201
value = ifelse(vel X>0,-5*var(12),5*var(12))

[State 1416, Reset Pos]
type = PosSet
trigger1 = !Time
Y = 0

[State 1406, Gravity]
type = Gravity
trigger1 = 1

[State 1406, Stop]
type = PosFreeze
trigger1 = var(58)=3

[State 1415, Hit Floor]
type = ChangeState
trigger1 = (Pos Y >= 0) && time>1 && var(58)<3
value = 72401

[State 1415, Hit Floor]
type = trans
trigger1 = time>100 && time<126
trans = addalpha
alpha = 256-10*(time-100), 10*(time-100)

[State 1003, DestroySelf]
type = DestroySelf
trigger1 = time=126

;======================================================================
;GOOMBA HELPER

[Statedef 72500]
type    = S
movetype= I
physics = N
anim = 72500
sprpriority = 5

[State 1003, fall]
type = Changeanim
trigger1 = anim=72500 && root,stateno=7141 ;726
value = 15999  ;72501

[State 1003, fall]
type = Velset
trigger1 = anim=15999 && animelemtime(1)=0
X = -2.5
Y = -9

[State 1003, fall]
type = VelAdd
trigger1 = anim=15999
Y = 0.5

[State 1003, fall]
type = VelMul
trigger1 = anim=15999 && vel Y > 0
X = 0.92

[state 1215, Smoke FX]
type = explod
trigger1 = anim=15999 && !numexplod(72501)
anim = 72501
id = 72501
pos = 0,0
postype = P1
bindtime = -1
sprpriority = 7
ontop = 1
ownpal = 1
removetime = 45
ignorehitpause = 1

[State 182, 1]
type = screenbound
trigger1 = 1
movecamera = 0,0
value = 0

[State 182, 1]
type = assertspecial
trigger1 = pos Y > 0
flag = noshadow

[State 1003, DestroySelf]
type = DestroySelf
trigger1 = time=180

;======================================================================
;BURTA HELPER

[Statedef 73000]
type    = S
movetype= I
physics = N
anim = 73000
sprpriority = -1
ctrl = 0

[State 182, 1]
type = screenbound
trigger1 = 1
movecamera = 0,0
value = 0

[State 1305, bind when fall and hit]
type = BindToRoot
trigger1 = root,stateno=706 ;712 ;730
pos = 0,0

[state 1215, overlay when fall]
type = explod
trigger1 = !time
anim = 73002
id = 73002
pos = 0,0
postype = P1
sprpriority = 3
ownpal = 1
removetime = -1
ignorehitpause = 0
bindtime = -1

[state 1215, overlay]
type = removeexplod
trigger1 = anim=73000 && root,anim=731
ID = 73002

[state 1215, overlay when hit]
type = explod
trigger1 = anim=73001
anim = 73003
id = 73003
pos = 0,0
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 0
bindtime = -1

[State 115, hurt Sound]
type = PlaySnd
trigger1 = anim=73000 && root,anim=731
value = 730,random%3

[State 1003, fall]
type = Changeanim
trigger1 = anim=73000 && root,anim=731
value = 73001

[State 1003, bounce]
type = ChangeState
trigger1 = anim=73001 && root,stateno=7121 ;732
value = 73004

;--------------------------
;bounce
[Statedef 73004]
type    = S
movetype= I
physics = N
anim = 73004
sprpriority = -1
velset = 0, -6
ctrl = 0

[State 1003, fall]
type = null;Veladd
trigger1 = time > 2
Y = 0.5

[State 1003, fall]
type = null ;ChangeState
trigger1 = anim=73004 && pos Y > -10 && time > 10
value = 73005

[State 1003, fall]
type = Veladd
trigger1 = time > 2
Y = 0.32

[State 1003, fall]
type = ChangeState
trigger1 = time = 40
value = 73006

;--------------------------
; on ground and rebounce
[Statedef 73005]
type    = S
movetype= I
physics = N
anim = 73000
sprpriority = -1
velset = 0, -1
ctrl = 0

[State 1003, bounce again]
type = ChangeAnim
trigger1 = time = 2
value = 73004

[State 1003, fall]
type = Velset
trigger1 = time = 2
Y = -5

[State 1003, fall]
type = Veladd
trigger1 = time > 5
Y = 0.5

[State 1003, sent out]
type = ChangeState
trigger1 = time = 9
value = 73006

;--------------------------
; sent out
[Statedef 73006]
type    = S
movetype= I
physics = N
anim = 73006
sprpriority = -1
velset = -8, 0
ctrl = 0

[State 115, hurt Sound]
type = PlaySnd
trigger1 = !time
value = 730,random%3

[State 1003, pos]
type = posset
trigger1 = !time
Y = 14

[State 182, 1]
type = screenbound
trigger1 = 1
movecamera = 0,0
value = 0

[State 182, 1]
type = destroyself
trigger1 = time = 20


;======================================================================
;SAIBAMEN HELPER

[Statedef 18801]
type    = S
movetype= I
physics = N
anim = 18801
sprpriority = 5

[State 182, 1]
type = screenbound
trigger1 = 1
movecamera = 0,0
value = 0

[State 115, digging]
type = PlaySnd
trigger1 = !time
value = 188,1
;volume = -100

[State 115, emerging]
type = PlaySnd
trigger1 = anim=18801 && animelemtime(6)=0
value = 188,2
volume = -200

[state 1215, Rising Effect smoke]
type = explod
trigger1 = anim=18801 && animelemtime(6)=0
anim = 1216
id = 1216
pos = -30,0
postype = P1
sprpriority = 4
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 0

[State 115, shouting]
type = PlaySnd
trigger1 = anim=18801 && animelemtime(6)=0
value = 188,5+random%3

[State 1003, to laugh]
type = Changeanim
trigger1 = anim=18801 && !animtime
value = 18802 + random%3

[State 115, laughing]
type = PlaySnd
trigger1 = anim>=18802 && animelemtime(2)=0
value = 188,8+random%2
persistent = 0

;==========================================================
; SAIYAN POD INTRO
[Statedef 19300]
type    = S
movetype= A
physics = N
anim = 19300
sprpriority = 3

[State 2260, muteki]
type = NotHitBy
trigger1 = 1
value = SCA

[State 0, BindToRoot - comes with Vegeta]
type = BindToRoot
trigger1 = root,anim = 193
time = 1
pos = 0,0
ignorehitpause =  1

[state 17100, smoke FX]
type=explod
trigger1 = time = 200
anim= 956
pos=0,-ceil(Pos Y)
postype=P1
sprpriority=-5
ownpal=1
supermovetime=-1
removetime = -2
persistent = 0
scale = 1,1

;-----------------------------
[State 2260, Opening pod]
type = ChangeAnim
trigger1 = time=220
value = 19301

[State 2260, Opening pod]
type = SprPriority
trigger1 = Anim=19301 && animelem=3
value = -2

[State 2260, Opening pod Sound]
type = PlaySnd
trigger1 = time=220
value = 193,3

[State 1315, Back pod]
type = explod
trigger1 = time=220
anim = 19302
ID = 19302
sprpriority = -3
postype = p1
pos = 0,0
removetime = -2
ownpal=1

[State 1315, Side FG pod]
type = explod
trigger1 = time=220
anim = 19303
ID = 19303
sprpriority = 2
postype = p1
pos = 0,0
removetime = -2
ownpal=1

[State 1315, Side FG pod - remove]
type = removeexplod
trigger1 = time = 303
ID = 19303

;-----------------------------
[State 2260, Closing pod]
type = ChangeAnim
trigger1 = time=320
value = 19305

[State 2260, Closing pod Sound]
type = PlaySnd
trigger1 = time=320
value = 193,5

[State 1315, Back pod - remove]
type = removeexplod
trigger1 = time = 332
ID = 19302

[state 17100, smoke FX]
type=explod
trigger1 = time = 400
anim= 956
pos=0,-ceil(Pos Y)
postype=P1
sprpriority=-5
ownpal=1
supermovetime=-1
removetime = 120
persistent = 0
scale = 1,1

[State 0, velset]
type = Velset
trigger1 = time=400
X = 0
Y = -.5

[State 2260, Pod going up]
type = PlaySnd
trigger1 = time=400
value = 193,2

[State 0, velset]
type = Velset
trigger1 = time>=450 && time<520
X = 0
Y = 1.5*sin(time-480)

[State 2260, Flying away]
type = PlaySnd
trigger1 = time=430
value = 193,0

[State 0, velset]
type = VelAdd
trigger1 = time >= 530
X = 1
Y = -2

[State 2260, destroy]
type = DestroySelf
trigger1 = time = 580

;==========================================================
; MAJIN POD INTRO
[Statedef 19400]
type    = S
movetype= A
physics = N
anim = 19300
sprpriority = 3

[State 19400, muteki]
type = NotHitBy
trigger1 = 1
value = SCA

[State 19400, BindToRoot - comes with Vegeta]
type = BindToRoot
trigger1 = root,anim = 193
time = 1
pos = 0,0
ignorehitpause =  1

[state 19400, smoke FX]
type=explod
trigger1 = time = 200
anim= 956
pos=0,-ceil(Pos Y)
postype=P1
sprpriority=-5
ownpal=1
supermovetime=-1
removetime = -2
persistent = 0
scale = 1,1

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

[State 19400, Opening pod Sound]
type = PlaySnd
trigger1 = time=230
trigger2 = time=250
value = 850,1 ;193,3


[State 19400, Shake 1]
type = Offset
trigger1 = time=[230,240]
x = 2*cos(time-230)
y = 2*sin(time-230)

[State 19400, Shake 2]
type = Offset
trigger1 = time=[250,260]
x = 2*cos(time-250)
y = 2*sin(time-250)

[state 19400, question mark]
type = explod
trigger1 = time=240
anim = 713
id = 713
pos = 50,-50
postype = P1
sprpriority = 8
ownpal = 1
removetime = -2
persistent = 0
scale = 1,1
facing = facing
bindtime = -1

[State 19400, Hmmmp]
type = playsnd
triggerall = var(55)=0		;Voice=English
trigger1 = time=260
value = 181,6+random%3
volume = 300
channel = 0

[State 19400, Hmmmp]
type = playsnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = time=260
value = 181,5
volume = 300
channel = 0

[State 19400, Hmmmp]
type = playsnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = time=260
value = 181,10+random%2
volume = 300
channel = 0



[State 19400, Opening pod]
type = ChangeAnim
trigger1 = time=280
value = 19402

[State 19400, Opening pod]
type = SprPriority
trigger1 = Anim=19402 && animelem=1
value = -2

[State 19400, Back pod]
type = explod
trigger1 = time=280
anim = 19402
ID = 19402
sprpriority = -3
postype = p1
pos = 0,0
removetime = -2
ownpal=1

[State 19400, Side FG pod]
type = explod
trigger1 = time=280
anim = 19403
ID = 19403
sprpriority = 2
postype = p1
pos = 0,0
removetime = -2
ownpal=1

[State 19400, hit spark]
type = explod
trigger1 = time=280
anim = 7020
ID = 7020
sprpriority = 4
postype = p1
pos = 60,-50
removetime = -2
ownpal=1

[State 19400, Broken door pod]
type = explod
trigger1 = time=280
anim = 19404
ID = 19404
sprpriority = 5
postype = p1
pos = 0,0
vel = 10,-9
accel = 0,0.5
removetime = -2
ownpal=1

[State 19400, sound kick]
type = PlaySnd
trigger1 = time = 280
value = 5,5

[State 19400, broken pod]
type = PlaySnd
trigger1 = time = 280
value = 720,0

[State 19400, Side FG pod - remove]
type = removeexplod
trigger1 = time = 303
ID = 19403

[State 19400, sound door on ground]
type = PlaySnd
trigger1 = time = 320
value = 800,2

[State 19400, Broken door pod - remove]
type = removeexplod
trigger1 = time = 400
ID = 19404

;-----------------------------
[State 19400, Closing pod]
type = ChangeAnim
trigger1 = time=320
value = 19402

[State 19400, Back pod - remove]
type = removeexplod
trigger1 = time = 320
ID = 19402

[state 19400, smoke FX]
type=explod
trigger1 = time = 400
anim= 956
pos=0,-ceil(Pos Y)
postype=P1
sprpriority=-5
ownpal=1
supermovetime=-1
removetime = 120
persistent = 0
scale = 1,1

[State 19400, velset]
type = Velset
trigger1 = time=400
X = 0
Y = -.5

[State 19400, Explosion]
type = Explod
trigger1 = time = 400
trigger2 = time = 520
trigger3 = time = 580
trigger4 = time = 700
anim = 3021
ID = 3021
pos = 0,-40
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 80,10
removetime = -2
pausemovetime = 0
scale = 1,1
sprpriority = -10
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0
;ignorehitpause =
trans = none
;persistent =
;supermove = 0
;pausemove = 0


[State 19400, spark sfx]
type = PlaySnd
trigger1 = time = 400
trigger2 = time = 520
trigger3 = time = 580
trigger4 = time = 700
value = 720,1

[State 19400, About to explode]
type = PalFX
trigger1 = time = 400
trigger2 = time = 520
trigger3 = time = 580
trigger4 = time = 700
time = 12
add = 100,100,100
mul = 256,256,256
sinadd = -80,-80,-80,10
invertall = 0
color = 256
;ignorehitpause = 0
;persistent = 1

[State 19400, Pod going up]
type = PlaySnd
trigger1 = time=400
value = 193,2

[State 19400, velset]
type = Velset
trigger1 = time>=450 && time<515
X = 0
Y = 1.5*sin(time-480)

[State 19400, velset]
type = VelAdd
trigger1 = time = [530,550)
X = 0.2
Y = -0.1

[State 19400, velset]
type = VelSet
trigger1 = time = 550
;X = 0
Y = 0

[State 19400, Flying away]
type = PlaySnd
trigger1 = time=430
value = 193,0

[State 19400, Shake]
type = Offset
trigger1 = time >=550
x = 2*cos(time-550)
y = 2*sin(time-550)


[State 19400, velset]
type = PosAdd ;VelAdd
trigger1 = time = [550,580]
Y = -1*(time-549)**(1/(time-549))

[State 19400, velset]
type = VelSet
trigger1 = time >580
Y = 0.1


[State 19400, BGPalFX]
type = BGPalFX
trigger1 = time = 700
time = 12
add = 7,-200,-200
mul = 256,256,256
sinadd = 30,30,0,10
invertall = 0
color = 0 ;256


[State 19400, shake]
type = envshake
trigger1 = time = 700
time = 12
freq = 60
ampl = 4

[State 19400, Explosion Sound]
type = PlaySnd
trigger1 = time = 700
value = 3330, 1
volume = 100

[State 19400, destroy]
type = DestroySelf
trigger1 = time = 720

;======================================================================
;OOZARU TAIL HELPER
[Statedef 19704]
type    = S
movetype= I
physics = N
anim = 19704
sprpriority = -10

[State 182, 1]
type = screenbound
trigger1 = 1
movecamera = 0,0
value = 0

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

[State 0, Gravity]
type = Gravity
trigger1 = time>=190 ;65
;ignorehitpause =
;persistent =

[State 0, VelSet]
type = VelSet
trigger1 = time=190 ;65
x = 2
;ignorehitpause =
;persistent =


[State 0, ChangeState]
type = ChangeState
trigger1 = pos Y>=0
value = 19708
ctrl = 0
;anim =
;ignorehitpause =
;persistent =

[State 0, DestroySelf]
type = DestroySelf
trigger1 =  time = 230 ;100

;======================================================================
;OOZARU CAMERA
[Statedef 19705]
type    = S
movetype= I
physics = N
anim = 9999
sprpriority = -10

[State 19705, 1]
type = screenbound
trigger1 = 1
movecamera = 0,1
value = 1

[State 19705, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
;value2 = S,NA
time = 1
ignorehitpause = 1
;persistent =

[State 19705, PosSet]
type = PosSet
trigger1 = !time
x = 0
y = -180 ;200 ;-220 ;145
;ignorehitpause =
;persistent =


[State 19705, Gravity]
type = null ;Gravity
trigger1 = time>=85 ;80 ;60
;ignorehitpause =
;persistent =

[State 0, VelSet]
type = VelSet
trigger1 = time=185
x = 0
y = 2.5 ;0.3
;ignorehitpause =
;persistent =


[State 19705, DestroySelf]
type = DestroySelf
trigger1 =  time = 250 ;80

;======================================================================
;TAIL BOUNCE HELPER
[Statedef 19708]
type    = S
movetype= I
physics = N ;S
anim = 19708
velset = 0,0
sprpriority = -10

[State 0, Gravity]
type = Gravity
trigger1 = time<100

[State 0, VelSet]
type = VelSet
trigger1 = !time
x = 2
y = -3

[State 0, PosSet]
type = PosSet
trigger1 = !time
trigger2 = pos Y>0 && vel Y>0
y = 0

[State 0, bounce]
type = VelSet
triggerall = time<100
triggerall = vel X >0
trigger1 = pos Y=0 && vel Y>0
x = 2.0 - 0.02*time
y = -1.5 + 0.015*time

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

[State 0, VelSet]
type = PosSet
trigger1 = time =100
y = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time =100
value = 19709

[State 0, ChangeState]
type = ChangeState
trigger1 =  time = 800 ;roundstate = 3
value = 19710
ctrl = 0

[State 0, DestroySelf]
type = DestroySelf
trigger1 =  time = 810 ;roundstate = 4

;TAIL BOUNCE END
[Statedef 19710]
type    = S
movetype= I
physics = N ;S
anim = 19710
velset = 0,0
sprpriority = -10

[State 747, Fade Away]
type = Trans
trigger1 = 1
trans = addalpha
alpha = 256-4*(time),0+4*(time)

[State 0, DestroySelf]
type = DestroySelf
trigger1 =  time = 65

;======================================================================
;YAJI HELPER SLASH
[Statedef 19706]
type    = S
movetype= I
physics = N
anim = 19706
sprpriority = -5

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

[State 0, VelSet]
type = VelSet
trigger1 = !time
x = 3 ;10
y = -5
;ignorehitpause =
;persistent =

[State 0, Gravity]
type = Gravity
trigger1 = 1 ;Pos Y <0
;ignorehitpause =
;persistent =

[State 182, 1]
type = screenbound
trigger1 = 1
movecamera = 0,0
value = 0

[State 19707, Cut Tail]
type = PlaySnd
trigger1 =  time=35 ;8
value = 19703,0
volume = 0
channel = -1

[State 0, ChangeState]
type = ChangeState
trigger1 = pos Y>=0
value = 19707
ctrl = 0
;anim =
;ignorehitpause =
;persistent =

[State 0, DestroySelf]
type = DestroySelf
trigger1 =  time = 200

;======================================================================
;YAJI HELPER DASH
[Statedef 19707]
type    = S
movetype= I
physics = N
anim = 19707
sprpriority = -5

[State 19707, 1]
type = screenbound
trigger1 = 1
movecamera = 0,0
value = 0

[State 19707, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
;value2 = S,NA
time = 1
ignorehitpause = 1


[State 19707, PosSet]
type = PosSet
trigger1 = !time
y = 0


[State 19707, PlaySnd]
type = PlaySnd
trigger1 =  !time
value = 40,0
volume = 0
channel = -1

[State 19707, Vel Stop]
type = VelSet
trigger1 = !time
x = 0
y = 0

[State 19707, Shake]
type = Offset
trigger1 = time = [30,50]
trigger1 = time%2=0
y = -10

[State 19707, PlaySnd]
type = PlaySnd
trigger1 =  time = 40 ;10
value = 710,1
volume = 0
channel = -1

[state 19707, smoke FX]
type = explod
trigger1 = time=30 ;15
trigger2 = time=60
anim = 10000
pos = -30,0
postype = P1
sprpriority = -8
ownpal = 1
supermovetime = -1
removetime = -2
;persistent = 0
scale = 1,1

[State 19707, VelSet]
type = VelSet
trigger1 = Time =50 ;35 ;25 ;20
x = 10

[State 0, SprPriority]
type = null ;SprPriority
trigger1 = time>=50 ;35
value = 10
;ignorehitpause =
;persistent =


[State 19707, DestroySelf]
type = DestroySelf
trigger1 = (pos x!=[-300,300])
trigger2 =  time = 120

;======================================================================
;BULMA INTRO HELPER
[Statedef 19722]
type    = S
movetype= I
physics = N
sprpriority = 0
;anim = 19722

[State 19722, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0
ignorehitpause = 1
;persistent =

[State 19722, ChangeAnim]
type = ChangeAnim
trigger1 = !time
value = 19722+gametime%2
;ignorehitpause =
;persistent =

[State 19722, Talk Stand]
type = explod
triggerall = time = 50
trigger1 = !NumExplod(19725)
trigger1 = Anim=19722
anim = 19725
ID = 19725
pos = 0,0
postype = P1
sprpriority = 1
ownpal = 1
supermovetime = -1
removetime = -2
persistent = 0
scale = 1,1

[State 19722, Talk Boast]
type = explod
triggerall = time = 50
trigger1 = !NumExplod(19726)
trigger1 = Anim=19723
anim = 19726
ID = 19726
pos = 0,0
postype = P1
sprpriority = 1
ownpal = 1
supermovetime = -1
removetime = -2
persistent = 0
scale = 1,1

[State 19722, PalFX]
type = PalFX
trigger1 = root,Anim=19727
trigger1 = root,AnimElemtime(7)=0
time = 6
add = 240,50,0
mul = 250,224,120
sinadd = 110,55,85,10
invertall = 0
color = 0
;ignorehitpause = 0
;persistent = 1

[State 19722, ChangeAnim]
type = ChangeAnim
;trigger1 = time = 150
trigger1 = root,Anim=19727
trigger1 = root,AnimElemtime(8)=0
value = 19724
ignorehitpause = 1
;persistent =

[State 0, SprPriority]
type = SprPriority
trigger1 = root,Anim=19727
trigger1 = root,AnimElemtime(8)=0
value = 2
;ignorehitpause =
;persistent =


[State 19722, VelSet]
type = VelSet
;trigger1 = time = 160
trigger1 = root,Anim=19727
trigger1 = root,AnimElemtime(9)=0
x = 10
y = -1.5
;ignorehitpause =
;persistent =

[State 19722, DestroySelf]
type = DestroySelf
trigger1 = Root,StateNo=0

;BULMA WINPOSE HELPER
[Statedef 19730]
type    = S
movetype= I
physics = N
sprpriority = 0
;anim = 19722

[State 19730, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0
ignorehitpause = 1
;persistent =

[State 19730, ChangeAnim]
type = ChangeAnim
trigger1 = !time
value = 19730+gametime%2
;ignorehitpause =
;persistent =

[State 19730, VelSet]
type = VelSet
trigger1 = !time
x = 8
y = 0
;ignorehitpause =
;persistent =

[State 19722, Roll out!] ;"Capsule One, Transform!/Where do you think you're going?"
type = PlaySnd
trigger1 = time = 1
trigger1 = gametime%2=0
value = 3920,40+random%2
volume = 100
channel = 8
persistent = 0

[State 19730, Car Run]
type = PlaySnd
triggerall = Anim=19730
trigger1 = RootDist X <= 300
value = 3920,0
volume = 0
channel = -1
persistent = 0

[State 19730, Robot Dash]
type = PlaySnd
triggerall = Anim=19731
trigger1 = RootDist X <= 300
value = 715,0
volume = 0
channel = -1
persistent = 0

[State 19730, Dust FX]
type = explod
trigger1 = !NumExplod(10000)
trigger1 = RootDist X <= 200
anim = 10000
ID = 10000
pos = 0,0
postype = P1
sprpriority = -8
ownpal = 1
supermovetime = -1
removetime = -2
bindtime = -1
persistent = 1
scale = 1,1

[State 19730, Car Horn]
type = PlaySnd
triggerall = Anim=19730
trigger1 = RootDist X <= 100
value = 3920,1
volume = 0
channel = -1
persistent = 0

[State 19730, Robot Grab]
type = PlaySnd
triggerall = Anim=19731
trigger1 = RootDist X <= 100
value = 800,1
volume = 0
channel = -1
persistent = 0

[State 19722, POW] ;"POW! Right in the kisser!" "Yes!"
type = PlaySnd
trigger1 = RootDist X <= 100
value = 3920,42+random%3
volume = 100
channel = 8
lowpriority = 1
persistent = 0


[State 19730, DestroySelf]
type = DestroySelf
trigger1 = roundstate!=[3,4]

;====================================
;-------------------------------------
;Babidi Intro Blast
[Statedef 19747]
type    = S
movetype= A
physics = N
anim = 1010
sprpriority = 5


[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 1061, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1


[State 1061, Velocity]
type = VelSet
trigger1 = Time = 0
x = 8




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

[State 1061, End]
type = destroyself
trigger1 = (pos x!=[-240,240])
trigger2 = time>180

[State 1061, Fade]
type = changestate
trigger1 = movecontact
value = 1030
ignorehitpause=1

;Rage Galactic Gunfire - Charged Ki Blast FX
[Statedef 2831]
type    = S
movetype= A
physics = N
anim = 2831
sprpriority = 5

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 1061, Velocity]
type = VelSet
trigger1 = Time = 0
y = 17

[State 13100, goes SND]
type = playsnd
trigger1 =  !time
value = 2000,2 ;6

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

[State 1061, End]
type = destroyself
trigger1 = (pos y!=[-1000,240])
trigger2 = time>120
trigger3 = root,stateno != 2830
trigger3 = root,stateno != 2835

;====================================
;Rage Galactic Gunfire - Charged Ki Blast FX hits
[Statedef 2836]
type    = S
movetype= A
physics = N
anim = 2831
sprpriority = 5

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 1061, Velocity]
type = VelSet
trigger1 = Time = 0
y = 17

[State 1061, End]
type = destroyself
trigger1 = (pos y!=[-1000,240])
trigger2 = time>180

[State 3055, end]
type = PlaySnd
trigger1 = pos y >= -10
value = s1000,0
persistent = 0
[State 13100, explosion sound]
type = playsnd
trigger1 = pos y >= -10
value = 2511,0
volume = 355
persistent = 0

[State 13100, shake]
type = envshake
trigger1 = pos y >= -10
time = 15
freq = 180
ampl = 15

[State 800, scaling explod]
type = VarSet
trigger1 = !time
fvar(1) = 1.7

[state 1215, Explosion FX]
type = explod
trigger1 = pos y >= -10
anim = 2512
id = 2512
pos = 0,-20
postype = P1
sprpriority = 6
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 0
bindtime = 1
scale = fvar(1),fvar(1)

[State 13100, HitAdd]
type = HitAdd
trigger1 = pos y >= -10
value = 1

[State 1061, Fade]
type = changestate
trigger1 = abs(p2dist Y) < 5
trigger2 = pos Y >= -10
value = 1630
ignorehitpause=1

;==========================================================
; FINAL GALICK HO BEAM FX

[Statedef 2867]
type    = A
movetype= A
physics = N
velset = 0, 0
sprpriority = 0
anim = 2862

[State 1061, transparency]
type = Trans
trigger1 = root,var(2)=1
trans = addalpha
alpha = 200,128

[State 1305, Scale Explod]
type = BindToRoot
trigger1 = 1
pos = 0,0

[state 1215, Beam Head going down]
type = explod
trigger1 = !time
anim = 2864
id = 2864
pos = 0,-14
postype = P1
sprpriority = 0
ownpal = 1
removetime = 15
ignorehitpause = 1
bindtime = 1
vel = 0,14

[state 1215, Beam scaling part]
type = explod
trigger1 = !time
anim = 2863
id = 2863
pos = 0,0
postype = P1
sprpriority = 0
ownpal = 1
removetime = -1
ignorehitpause = 0
bindtime = -1
scale = 1,1

[State 1305, Scale Explod]
type = ModifyExplod
trigger1 = time < 12
scale = 1,1+time
ID = 2863

[State 1305, Scale Explod]
type = ModifyExplod
;trigger1 = time >= 12
trigger1 = time = [12,179]
scale = 1,13
ID = 2863

[state 1215, Beam Head going up]
type = explod
trigger1 = time=12
anim = 2864
id = 2864
pos = 0,14*(time - 1)
postype = P1
sprpriority = 0
ownpal = 1
removetime = 12
ignorehitpause = 1
bindtime = 1
vel = 0,-18

[state 1215, Beam Head static]
type = explod
trigger1 = time=24
anim = 2864
id = 2864
pos = 0, 167
postype = P1
sprpriority = 0
ownpal = 1
removetime = -1
ignorehitpause = 1
bindtime = 1
vel = 0,0

[State 1305, remove static Explod]
type = RemoveExplod
trigger1 = time = 180
ID = 2864

[state 1215, Beam Head going down after hit]
type = explod
trigger1 = time=180
anim = 2864
id = 2864
pos = 0, 167
postype = P1
sprpriority = 0
ownpal = 1
removetime = -1
ignorehitpause = 1
bindtime = 1
vel = 0,14

[State 1305, Scale Beam Explod]
type = ModifyExplod
trigger1 = time >= 180
scale = 1+0.1*(time-180),15+(time-180)
ID = 2863

[State 1305, Scale HeadExplod]
type = ModifyExplod
trigger1 = time >= 180
scale = 1+0.1*(time-180),1+0.1*(time-180)
ID = 2864

[State 13300, white screen fade]
type = Explod
trigger1 = Time = 155
anim = 2870
ID = 2870
postype = left
pos = 0,-50
bindtime = -1
removetime = -2
ownpal = 1
ontop = 1
sprpriority = 5
scale = 2,3
ignorehitpause = 1
facing = 1

[State 1305, Remove Explod]
type = RemoveExplod
trigger1 = time =235  ;230
ID = 2863
[State 1305, Remove Explod]
type = RemoveExplod
trigger1 = time =235
ID = 2864

[State 1305, Remove Explod if fatality]
type = RemoveExplod
trigger1 = enemy,stateno=2875
ID = 2870

[State 1305, THAT'S ALL FOLKS]
type = DestroySelf
trigger1 = time =235

;------------------------------------------------
; Vertical white foreground Final Galick Ho fatality

[Statedef 2876]
type    = S
movetype= I
physics = N
anim = 5944
sprpriority = 8

[State 2260, muteki]
type = NotHitBy
trigger1 = 1
value = SCA

[State 0, rotate]
type = AngleDraw
trigger1 = 1
value = -90

[State 2260, destroy]
type = DestroySelf
trigger1 = !animtime


;======================================================================
;DIRTY FIREWORKS DEBRIS HELPER
[Statedef 2848]
type    = S
movetype= I
physics = N
anim = 15999

[State 200, debris falling]
type = PlaySnd
trigger1 = time=50
value = 2848,0
volume = 300
persistent = 0

[State 1000, Helper]
type = Helper
trigger1 = time>60 && numhelper(2849)<10 && numhelper(2850)<10
helpertype = Normal
name = "debris_generator"
id = 2849
pos = 0,0
postype = p2
facing = 1
stateno = 2849
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1

[State 1003, DestroySelf]
type = DestroySelf
trigger1 = time > 70
;-------------------------------
;Debris Generator
[Statedef 2849]
type = A
movetype = I
physics = N
anim = 15999

[State 800, size]
type = VarSet
trigger1 = !time
fvar(0) = 0.1*(random%6)

[State 1003, Helper]
type = Helper
trigger1 = !time
helpertype = Normal
name = "debris2"
id = 2850
pos = -60+12*(random%15),-300+10*(random%10)  ;-120+%%
postype = p2
facing = 1
stateno = 2850
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1
size.xscale = 0.3+fvar(0)
size.yscale = 0.3+fvar(0)

[State 1003, DestroySelf]
type = DestroySelf
trigger1 = time=2
;-----------
[Statedef 2850]
type = A
movetype = I
physics = N
anim = 2850
velset = 0, 0.5 + 0.2*(random%6)
sprpriority = 3

[state 17100, smoke]
type = explod
trigger1 = !time
anim = 5930+random%2
id = 5930
pos = 0,10
postype = P1
sprpriority = 3
ownpal = 0
removetime = -1
bindtime = -1

[State 1406, No Shadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 1415, Hit Floor]
type = trans
trigger1 = time>190 && time<216
trans = addalpha
alpha = 256-9*(time-190), 9*(time-190)

[State 1415, trans]
type = modifyexplod
trigger1 = time>190 && time<216
trans = addalpha
alpha = 256-9*(time-190), 9*(time-190)
ID = 5930

[State 1406, No Shadow]
type = RemoveExplod
trigger1 = time >=216
ID = 5930

[State 1003, DestroySelf]
type = DestroySelf
trigger1 = time >=216



;===========================================================================
;===========================================================================
;<<<<<<<<<<<<<<<<<<<<<<<| MAJIN EXCLUSIVE HELPERS |>>>>>>>>>>>>>>>>>>>>>>>>>
;===========================================================================
;===========================================================================

;-------------------------------------------------------------------------------
;[MAJIN]
; Majin Bakuhatsu Helper
[Statedef 3020]
type    = S
movetype= A
physics = N
anim = 3020
sprpriority = 5
hitcountpersist = 1
movehitpersist = 1


[State 3020, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 3020, Transparency]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 3020, NoJuggle]
type = parentvarset
trigger1 = time = 0
var(18) = 1


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

[State 3020, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 3020, HitOverride]
type = HitOverride
;trigger1 = 1
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 3021
attr = SCA, NP, SP, HP
ignorehitpause = 1

[State 3020, Hitdef]
type = HitDef
trigger1 = 1
attr = S, SP
animtype = Back
air.animtype = Back
fall.animtype = Back
;damage    = ceil((5*root,var(15))+25*root,fvar(12)), ceil((2+root,var(15))*root,fvar(12))
damage = ceil(ifElse((root,fvar(11)) * ((5*root,var(15))+35) < 7, 7, (root,fvar(11)) * ((5*root,var(15))+35))), 3+(root,var(15))
priority  = 4,Hit
guardflag = L ;MA
hitflag = MAFD
pausetime = 0,10
guard.pausetime = 2,1
sparkno = s7020 ;-1 ;s7010
guard.sparkno = s7010 ;-1
sparkxy = -2,-62 ;0,-50
hitsound   = s2301,0
guardsound = S6,1
ground.type = High
air.type = Low
ground.hittime = 16
ground.slidetime = 16
guard.slidetime = 7
guard.hittime = 16
air.hittime = 13
airguard.ctrltime = 16
ground.velocity = -2,-2
guard.velocity = -2
air.velocity = -2,-5
airguard.velocity = -2, -2
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
fall=1
air.fall = 1
fall.recover = 0
fall.recovertime = 13
forcestand = 1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = 0,0  ;ifelse(p2movetype=H,40,140), 10
givepower = 35,35
;palfx.sinadd=64,64,64,4
;palfx.mul=128,128,128
;palfx.time=32
palfx.add = 255,50,0
palfx.sinadd = -255,-50,0,20
palfx.time = 25
persistent = 0

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1


[State 3020, Sparks]
type=null ;explod
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
anim=7020
sprpriority=7
postype=p2
pos=(target,const(size.ground.front)-2),-62 ;-77;floor(p2dist y)
removetime=-2
ownpal=1
facing=-1
ignorehitpause=1
persistent=0
pausemovetime=100
supermovetime=100

[State 3020, Guard Sparks]
type=null ;explod
trigger1= moveguarded
anim=7010
sprpriority=7
postype=p2
pos=(target,const(size.ground.front)-2),-62 ;-77;floor(p2dist y)
removetime=-2
ownpal=1
facing=-1
ignorehitpause=1
persistent=0
pausemovetime=100
supermovetime=100

[State 3020, Helper Limiter]
type = Helper
triggerall = !NumHelper(9998)
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
helpertype = normal
name =  "Limiter"
ID = 9998
stateno = 9999
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1

[state 3020, Flame overlay]
type = helper
triggerall = !NumHelper(9990)
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
trigger1 = target,IsHelper=0
pos = 0,0
postype = p2 ;left
ID = 9990
stateno = 9990
helpertype = normal
name = "Fire"
sprpriority = -5
ownpal = 1
ignorehitpause = 1


[State 3020, Guardshake]
type = envshake
trigger1 = moveguarded
time = 4
ampl = 6
freq = 176
ignorehitpause = 1

[State 3020, NoJuggle]
type = parentvarset
trigger1 = movecontact
var(18) = 0

[State 3020, end]   ;Contact
type = changestate
trigger1 = movecontact
value = 3021

[State 3020, end]   ;No contact
type = changestate
trigger1 = !animtime
value = 3021


[State 3020, End]   ;just in case
type = destroyself
trigger1 = !animtime

;-------------------------------------------------------------------------------
;[MAJIN]
; M.Bakuhatsu Vanish
[Statedef 3021]
type    = S
movetype= A
physics = N
velset=0,0
anim = 3021
ctrl=0
sprpriority=5


[State 3021, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 3321, Sound]
type = PlaySnd
trigger1 = !time
value = 3300, 1

[State 3021, nothitby]
type = nothitby
trigger1 = 1
time = 1
value = SCA
ignorehitpause = 1

[State 3021, Transparency]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 3021, End]
type= destroyself
trigger1 = !animtime


;-------------------------------------------------------------------------------
;[MAJIN]
; EX Majin Bakuhatsu Helper
[Statedef 3022]
type    = S
movetype= A
physics = N
anim = 3020
sprpriority = 5
hitcountpersist = 1
movehitpersist = 1


[State 3022, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 3022, Transparency]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 3022, NoJuggle]
type = parentvarset
trigger1 = time = 0
var(18) = 1


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

[State 3022, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 3022, HitOverride]
type = HitOverride
;trigger1 = 1
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 3023
attr = SCA, NP, SP, HP
ignorehitpause = 1

[State 3022, Hitdef]
type = HitDef
trigger1 = !parent, IsHelper;jnp fix
attr = S, SP
animtype = Back
air.animtype = Back
fall.animtype = Back
;damage    = ceil(15+25*root,fvar(12)), ceil(4*root,fvar(12))
damage = ceil(ifElse((root,fvar(11)) * 50 < 7, 7, (root,fvar(11)) * 50)), 5
priority  = 4,Hit
guardflag = L ;MA
hitflag = MAFD
pausetime = 0,0 ;0,10
guard.pausetime = 2,1
sparkno = -1 ;s7010
guard.sparkno = -1
sparkxy = 0,-50
hitsound   = s2301,0
guardsound = S6,1
ground.type = High
air.type = Low
ground.hittime = 16
ground.slidetime = 16
guard.slidetime = 7
guard.hittime = 16
air.hittime = 13
airguard.ctrltime = 16
ground.velocity = -5,-4 ;-2,-2
guard.velocity = -2
air.velocity = -5,-4 ;-2,-5
airguard.velocity = -2, -2
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
fall=1
air.fall = 1
fall.recover = 0
fall.recovertime = 13
forcestand = 1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = 0,0  ;ifelse(p2movetype=H,40,140), 10
givepower = 35,35
;palfx.sinadd=64,64,64,4
;palfx.mul=128,128,128
;palfx.time=32
palfx.add = 255,50,0
palfx.sinadd = -255,-50,0,20
palfx.time = 25
persistent = 0

[State 3022, Hitdef]
type = HitDef
trigger1 = parent, IsHelper;jnp fix
attr = S, SP
animtype = Back
air.animtype = Back
fall.animtype = Back
;damage    = ceil(15+25*root,fvar(12)), ceil(4*root,fvar(12))
damage = ceil(ifElse((root,fvar(11)) * 50 < 7, 7, (root,fvar(11)) * 50)), 5
priority  = 4,Hit
guardflag = MA
hitflag = MAFD
pausetime = 0,0 ;0,10
guard.pausetime = 2,1
sparkno = -1 ;s7010
guard.sparkno = -1
sparkxy = 0,-50
hitsound   = s2301,0
guardsound = S6,1
ground.type = High
air.type = Low
ground.hittime = 16
ground.slidetime = 16
guard.slidetime = 7
guard.hittime = 16
air.hittime = 13
airguard.ctrltime = 16
ground.velocity = -5,-4 ;-2,-2
guard.velocity = -2
air.velocity = -5,-4 ;-2,-5
airguard.velocity = -2, -2
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
fall=1
air.fall = 1
fall.recover = 0
fall.recovertime = 13
forcestand = 1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = 0,0  ;ifelse(p2movetype=H,40,140), 10
givepower = 35,35
;palfx.sinadd=64,64,64,4
;palfx.mul=128,128,128
;palfx.time=32
palfx.add = 255,50,0
palfx.sinadd = -255,-50,0,20
palfx.time = 25
persistent = 0

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[State 3022, Sparks]
type=explod
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
anim=7020
sprpriority=7
postype=p2
pos=(target,const(size.ground.front)-2),-62 ;-77;floor(p2dist y)
removetime=-2
ownpal=1
facing=-1
ignorehitpause=1
persistent=0
pausemovetime=100
supermovetime=100

[State 3022, Guard Sparks]
type=explod
trigger1= moveguarded
anim=7010
sprpriority=7
postype=p2
pos=(target,const(size.ground.front)-2),-62 ;-77;floor(p2dist y)
removetime=-2
ownpal=1
facing=-1
ignorehitpause=1
persistent=0
pausemovetime=100
supermovetime=100

[State 3022, Helper Limiter]
type = Helper
triggerall = !NumHelper(9998)
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
helpertype = normal
name =  "Limiter"
ID = 9998
stateno = 9999
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1

[state 3022, Flame overlay]
type = helper
triggerall = !NumHelper(9990)
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
trigger1 = target,IsHelper=0
pos = 0,0
postype = left
ID = 9990
stateno = 9990
helpertype = normal
name = "Fire"
sprpriority = -5
ownpal = 1
ignorehitpause = 1


[State 3022, Guardshake]
type = envshake
trigger1 = moveguarded
time = 4
ampl = 6
freq = 176
ignorehitpause = 1

[State 3022, NoJuggle]
type = parentvarset
trigger1 = movecontact
var(18) = 0

[State 3022, end]   ;Contact
type = changestate
trigger1 = movecontact
value = 3023

[State 3022, end]   ;No contact
type = changestate
trigger1 = !animtime
value = 3023


[State 3022, End]   ;just in case
type = destroyself
trigger1 = !animtime

;-------------------------------------------------------------------------------
;[MAJIN]
; EX M.Bakuhatsu Vanish
[Statedef 3023]
type    = S
movetype= A
physics = N
velset=0,0
anim = 3307 ;3021
ctrl=0
sprpriority=5

[State 3023, Offset]
type = Offset
trigger1 = 1
x = 0
y = -60
;ignorehitpause =
;persistent =

[State 3023, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
flag2 = invisible
ignorehitpause = 1

[State 3023, Explosion]
type = Explod
trigger1 = !time
anim =  3307
ID =  3307
pos = 0,0
postype = p1  ;p2,front,back,left,right
supermovetime = 9999
pausemovetime = 9999
facing = IfElse(Random%2,1,-1)
vfacing = IfElse(Random%2,1,-1)
bindtime = 1
removetime = -2
scale = 1,1
sprpriority = 5
ownpal = 1
removeongethit = 0
ignorehitpause = 1

[State 3023, Sound]
type = PlaySnd
trigger1 = !time
value = 3300, 1

[State 3023, nothitby]
type = nothitby
trigger1 = 1
time = 1
value = SCA
ignorehitpause = 1

[State 3023, Transparency]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 3023, End]
type= destroyself
trigger1 = !animtime

;-------------------------------------------------------------------------------
;[MAJIN]
; ATOMIC BLAST HELPER
[Statedef 3209]
type = A
movetype = A
physics = N
ctrl = 0
sprpriority = 10

[State 3302, anim]
type = changeanim
trigger1 = !time
value = 3209

[State 3302, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
;flag2 = invisible
ignorehitpause = 1

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

[State 3302, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 3302, HitOverride]
type = HitOverride
;trigger1 = 1
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 3210 ;3209
attr = SCA, NP, SP, HP
ignorehitpause = 1


[State 3302, Velocity]
type = VelSet
trigger1 = !time
x = 3

[State 3302, hit]
type = hitdef
trigger1 = 1
attr = S,HP
hitflag = MAFD
;guardflag = MA
priority = 7,Hit
damage = 0,0
getpower = 0,0
givepower = 0,0
pausetime = 0,0
animtype = Back
air.animtype = Back
fall.animtype = Back
ground.type = High
air.type = Low
ground.hittime = 16
ground.slidetime = 16
guard.hittime = 16
air.hittime = 13
airguard.ctrltime = 16
ground.velocity= 2,0
guard.velocity = 2 ;-9
air.velocity = -5.5,-3.9
airguard.velocity = -5.5, -1.5
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
yaccel = .5
fall=0
air.fall = 1
fall.recover = 0
fall.recovertime = 13
sparkno = -1
hitsound   = s1000,0
guardsound = S6,0
envshake.time = 16
envshake.ampl = 6
envshake.freq = 100
forcestand = 1
palfx.sinadd=64,64,64,4
palfx.mul=128,128,128
palfx.time=32
p1sprpriority = 10
ID = 3209
persistent=0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Anim=3209
trigger1 = movehit ;p2bodydist x<30
value = 3210
;elem = 1
ignorehitpause = 1
;persistent =

[State 0, PosSet]
type = PosSet
trigger1 = Anim=3210
y = 0
ignorehitpause = 1
;persistent =

[State 0, TargetState]
type = TargetState
trigger1 = numtarget(3209)
trigger1 = movehit
value = 32061
ID = -1
ignorehitpause = 1
persistent = 0

[State 0, TargetBind]
type = TargetBind
trigger1 = numtarget(3209)
trigger1 = target(3209),stateno=32061
time = 1
id = -1
;pos = IFElse((target(3209),Anim=120),20,70-50*(target(3209),Name = "Babidi Z2")-35*(target(3209),Name = "Gotenks Z2"))
pos = IFElse((target(3209),Anim=120),20,37)
ignorehitpause = 1
;persistent =

[State -2, dash Sound]
type = PlaySnd
trigger1 = numtarget
trigger1 = target,Stateno=32061
trigger1 = target,time=8 ;AnimElemTime(2)=0
;trigger2 = !numtarget
;trigger2 = enemy,Stateno=3206
;trigger2 = enemy,time=8
value = 3200, 0
channel = 5


[State -2, dash Sound loop]
type = PlaySnd
trigger1 = numtarget
trigger1 = target,Stateno=32061
trigger1 = target,time=23 ;AnimElemTime(2)=15
;trigger2 = !numtarget
;trigger2 = enemy,Stateno=3206
;trigger2 = enemy,time=23
value = 3200, 1
loop = 1
channel = 5

[State 3302, end]   ;Contact
type = changestate
trigger1 = numtarget(3209)
trigger1 = target,stateno=3207
trigger2 = Anim=3210 ;AB drag
trigger2 = !numtarget(3209) ;target is lost
value = 3210

[State -2, Dash StopSnd]
type = StopSnd
trigger1 = pos x!=[-240,240]
channel = 5

[State 3302, End]
type = destroyself
trigger1 = pos x!=[-240,240]

;-------------------------------------------------------------------------------
;[MAJIN]
; AB HELPER Vanish
[Statedef 3210]
type = A
movetype = A
physics = N
ctrl = 0
sprpriority = 10

[State -2, Dash StopSnd]
type = StopSnd
trigger1 = !time
channel = 5

[State 0, PosAdd]
type = PosAdd
trigger1 = !time
y = -55
ignorehitpause = 1
;persistent =

[State 3302, anim]
type = changeanim
trigger1 = !time
value = 3208

[State 0, HitDef]
type = HitDef
trigger1 = 1
attr = S,HP        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = MAFD        ;HLAFD+-
;guardflag = MA         ;HLA
getpower = 0,0
givepower = 0,0
animtype = medium ;light          ;light,medium,hard,back,up,diagup
priority = 4,Hit   ;Hit,Miss,Dodge
damage = ceil(ifElse((root,fvar(11)) * 100 < 53, 53, (root,fvar(11)) * 100)), 10
pausetime = 0,0
guard.pausetime = 0,0
sparkno = -1
guard.sparkno = -1
sparkxy = 0,0
ground.type = High      ;Low,Trip,None
ground.slidetime = 15
ground.hittime = 0 ;50
ground.velocity = 0,0
guard.velocity = 0
air.velocity = 0,0
airguard.velocity = 0,0
sprpriority = 10
;p2stateno = 32077
ignorehitpause = 1
persistent = 0

[State -2, Explosion Sound]
type = PlaySnd
trigger1 = time=3
value = 3330,1
channel = 6

[State 0, TargetState]
type = TargetState
trigger1 = numtarget
trigger1 = movehit
value = 32077
ID = -1
ignorehitpause = 1
persistent = 0


[State 3302, End]
type = destroyself
trigger1 = !animtime

;-------------------------------------------------------------------------------
;[MAJIN]
; PHOTON BOMBER HELPER
[Statedef 3302]
type = A
movetype = A
physics = N
ctrl = 0
sprpriority = 10

[State 3302, anim]
type = changeanim
trigger1 = !time
value = 3302

[State 3302, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
;flag2 = invisible
ignorehitpause = 1

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

[State 3302, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 3302, HitOverride]
type = HitOverride
;trigger1 = 1
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 33021
attr = SCA, NP, SP, HP
ignorehitpause = 1


[State 3302, Velocity]
type = VelSet
trigger1 = !time
x = 8 ;3

[State 3302, hit]
type = hitdef
trigger1 = 1
attr = S,HP
hitflag = MAFD
guardflag = MA
priority = 7,Hit
;damage = 30,3
;damage = ceil(ifElse((root,fvar(11)) * 30 < 7, 7, (root,fvar(11)) * 30)), 3
damage = ceil(ifElse((root,fvar(11)) * 30 < 10, 10, (root,fvar(11)) * 30)), 3
getpower = 0,0
givepower = 20,20
pausetime = 8, 8
animtype = Back
air.animtype = Back
fall.animtype = Back
ground.type = High
air.type = Low
ground.hittime = 16
ground.slidetime = 16
guard.hittime = 16
air.hittime = 13
airguard.ctrltime = 16
ground.velocity= 2,0
guard.velocity = 2 ;-9
air.velocity = -5.5,-3.9
airguard.velocity = -5.5, -1.5
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
yaccel = .5
fall=0
air.fall = 1
fall.recover = 0
fall.recovertime = 13
sparkno = -1
hitsound   = s1000,0
guardsound = S6,0
envshake.time = 16
envshake.ampl = 6
envshake.freq = 100
forcestand = 1
palfx.sinadd=64,64,64,4
palfx.mul=128,128,128
palfx.time=32
p1sprpriority = 5
persistent=0

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[State 3302, Sparks]
type=explod
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
anim=7020
sprpriority=7
postype=p2
pos=(target,const(size.ground.front)-2),-62 ;-77;floor(p2dist y)
removetime=-2
ownpal=1
facing=-1
ignorehitpause=1
persistent=0
pausemovetime=100
supermovetime=100

[State 3302, Guard Sparks]
type=explod
trigger1= moveguarded
anim=7010
sprpriority=7
postype=p2
pos=(target,const(size.ground.front)-2),-62 ;-77;floor(p2dist y)
removetime=-2
ownpal=1
facing=-1
ignorehitpause=1
persistent=0
pausemovetime=100
supermovetime=100

[State 3302, Helper Limiter]
type = Helper
triggerall = !NumHelper(9999)
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
helpertype = normal
name = "Limiter"
ID = 9999
stateno = 9999
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1


[state 3302, Flame overlay]
type = helper
triggerall = !NumHelper(9990)
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
trigger1 = target,IsHelper=0
pos = 0,0
postype = left
ID = 9990
stateno = 9990
helpertype = normal
name = "Fire"
sprpriority = -5
ownpal = 1
ignorehitpause = 1

[State 3302, end]   ;Contact
type = changestate
trigger1 = movecontact
value = 33021

[State 3302, End]
type = destroyself
trigger1 = pos x!=[-240,240]


;-----------------------------------------
;[MAJIN]
; PB explod/vanish
[Statedef 33021]
type=A
movetype=A
physics=N
velset=1,0
ctrl=0
sprpriority=-5

[State 33021, anim]
type = changeanim
trigger1 = !time
value = 3303

[State 33021, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
flag2 = nojugglecheck
;flag3 = invisible
ignorehitpause = 1

[State 33021, Projectile 1]
type = Projectile
trigger1 = AnimElemTime(3)=0
ProjID =  3307
projanim = 3307
projhitanim = 3307
projscale = 1,1
projremovetime = 24 ;-1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
velmul = 1
projhits = 1
projpriority = 1
projsprpriority = 6
projedgebound = 40
projstagebound = 40
projheightbound = -240
offset = -30,30
postype = p1
projshadow = 0,0,0
supermovetime = 0
pausemovetime = 0
; HitDef
attr = SCA,NP,SP,HP        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = MAFD        ;HLAFD+-
guardflag = MA         ;HLA
getpower = 0,0
givepower = 0,0
affectteam = E          ;B,E,F
animtype = hard          ;light,medium,hard,back,up,diagup
priority = 4,Hit   ;Hit,Miss,Dodge
;damage = ceil(30*root,fvar(12)),ceil(3*root,fvar(12))
;damage = ceil(ifElse((root,fvar(11)) * 30 < 7, 7, (root,fvar(11)) * 30)), 3
damage = ceil(ifElse((root,fvar(11)) * 30 < 10, 10, (root,fvar(11)) * 30)), 3
pausetime = 0,0
guard.pausetime = 0,0
sparkno = 0
guard.sparkno = 0
sparkxy = 0,0
hitsound = S3300,2
guardsound = S6,0
ground.type = Low      ;Low,Trip,None
ground.velocity = -1,-2
air.velocity = -1,-2
fall = 0
fall.recover = 0
persistent = 0

[State 33021, Projectile 2]
type = Projectile
trigger1 = AnimElemTime(6)=0
ProjID =  3307
projanim = 3307
projhitanim = 3307
projscale = -1,-1
projremovetime = 24 ;-1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
velmul = 1
projhits = 1
projpriority = 1
projsprpriority = 6
projedgebound = 40
projstagebound = 40
projheightbound = -240
offset = 30,-30
postype = p1
projshadow = 0,0,0
supermovetime = 0
pausemovetime = 0
; HitDef
attr = SCA,NP,SP,HP        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = MAFD        ;HLAFD+-
guardflag = MA         ;HLA
getpower = 0,0
givepower = 0,0
affectteam = E          ;B,E,F
animtype = back ;hard          ;light,medium,hard,back,up,diagup
priority = 4,Hit   ;Hit,Miss,Dodge
;damage = ceil(30*root,fvar(12)),ceil(3*root,fvar(12))
;damage = ceil(ifElse((root,fvar(11)) * 30 < 7, 7, (root,fvar(11)) * 30)), 3
damage = ceil(ifElse((root,fvar(11)) * 30 < 10, 10, (root,fvar(11)) * 30)), 3
pausetime = 0,0
guard.pausetime = 0,0
sparkno = 0
guard.sparkno = 0
sparkxy = 0,0
hitsound = S3300,2
guardsound = S6,0
ground.type = Low      ;Low,Trip,None
ground.velocity = 1,-2
air.velocity = 1,-2
fall = 0
fall.recover = 0
persistent = 0

[State 33021, Projectile 3]
type = Projectile
trigger1 = AnimElemTime(9)=0
ProjID =  3307
projanim = 3307
projhitanim = 3307
projscale = 1,-1
projremovetime = 24 ;-1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
velmul = 1
projhits = 1
projpriority = 1
projsprpriority = 6
projedgebound = 40
projstagebound = 40
projheightbound = -240
offset = -30,-30
postype = p1
projshadow = 0,0,0
supermovetime = 0
pausemovetime = 0
; HitDef
attr = SCA,NP,SP,HP        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = MAFD        ;HLAFD+-
guardflag = MA         ;HLA
getpower = 0,0
givepower = 0,0
affectteam = E          ;B,E,F
animtype = hard          ;light,medium,hard,back,up,diagup
priority = 4,Hit   ;Hit,Miss,Dodge
;damage = ceil(30*root,fvar(12)),ceil(3*root,fvar(12))
;damage = ceil(ifElse((root,fvar(11)) * 30 < 7, 7, (root,fvar(11)) * 30)), 3
damage = ceil(ifElse((root,fvar(11)) * 30 < 10, 10, (root,fvar(11)) * 30)), 3
pausetime = 0,0
guard.pausetime = 0,0
sparkno = 0
guard.sparkno = 0
sparkxy = 0,0
hitsound = S3300,2
guardsound = S6,0
ground.type = Low      ;Low,Trip,None
ground.velocity = -1,-2
air.velocity = -1,-2
fall = 0
fall.recover = 0
persistent = 0

[State 33021, Projectile 4]
type = Projectile
trigger1 = AnimElemTime(12)=0
ProjID =  3307
projanim = 3307
projhitanim = 3307
projscale = -1,1
projremovetime = 24 ;-1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
velmul = 1
projhits = 1
projpriority = 1
projsprpriority = 6
projedgebound = 40
projstagebound = 40
projheightbound = -240
offset = 30,30
postype = p1
projshadow = 0,0,0
supermovetime = 0
pausemovetime = 0
; HitDef
attr = SCA,NP,SP,HP        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = MAFD        ;HLAFD+-
guardflag = MA         ;HLA
getpower = 0,0
givepower = 0,0
affectteam = E          ;B,E,F
animtype = hard          ;light,medium,hard,back,up,diagup
priority = 4,Hit   ;Hit,Miss,Dodge
;damage = ceil(30*root,fvar(12)),ceil(3*root,fvar(12))
;damage = ceil(ifElse((root,fvar(11)) * 30 < 7, 7, (root,fvar(11)) * 30)), 3
damage = ceil(ifElse((root,fvar(11)) * 30 < 10, 10, (root,fvar(11)) * 30)), 3
pausetime = 0,0
guard.pausetime = 0,0
sparkno = 0
guard.sparkno = 0
sparkxy = 0,0
hitsound = S3300,2
guardsound = S6,0
ground.type = Low      ;Low,Trip,None
ground.velocity = -5,-2
air.velocity = -5,-2
fall = 1
fall.recover = 0
persistent = 0

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[State 33021, Sound]
type = PlaySnd
trigger1 = !time
value = 3300, 1

[State 33021, nothitby]
type = nothitby
trigger1 = 1
time = 1
value = SCA
ignorehitpause = 1

[State 33021, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 33021, End with Zzyzzyxx fix]
type= destroyself
;triggerall = !animtime
trigger1 = time >= 54
trigger2 = !animtime
;trigger2 = !numtarget
;trigger3 = numtarget
;trigger3 = target, time <= 1 && !(target, hitshakeover)



;-------------------------------------------------------------------------------
;[MAJIN]
; BIGBANG SHIELD HELPER
[Statedef 33210]
type = A
movetype = A
physics = N
ctrl = 0
sprpriority = 2
hitcountpersist = 1
;movehitpersist = 1

[State 0, VarSet]
type = VarSet
;triggerall = prevstateno!=33210
trigger1 = root,stateno=[3321,3322]
var(4) = root,var(4)
ignorehitpause = 1
;persistent =

[State 0, AngleDraw after spawn]
type = AngleDraw
trigger1 = prevstateno=33211
trigger1 = time>0 ;Scale hack
scale = 0.25+0.25*var(4),0.25+0.25*var(4)
ignorehitpause = 1
;persistent =
[State 0, AngleDraw Zero]
type = AngleDraw
trigger1 = prevstateno!=33211
trigger1 = time<25
scale = 0.02*time,0.02*time
ignorehitpause = 1
;persistent =
[State 0, AngleDraw after Zero]
type = AngleDraw
trigger1 = prevstateno!=33211
trigger1 = time>=25
scale = 0.25+0.25*var(4),0.25+0.25*var(4)
ignorehitpause = 1
;persistent =

[State 0, Width]
type = Width
trigger1 = 1
value = 8*var(4),8*var(4)
ignorehitpause = 1
;persistent =

[State 33210, anim]
type = changeanim
triggerall = prevstateno!=33211
trigger1 = !time
trigger2 = Anim!=3330+var(4) ;!animtime
value = 3330+var(4)
ignorehitpause = 1

[State 33210, anim after spawn]
type = changeanim
triggerall = prevstateno=33211
trigger1 = !time
value = 3330+var(4) ;33210
elem = var(2)
ignorehitpause = 1

[State 33210, transparency]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 0, PosAdd]
type = PosAdd
triggerall = root,stateno=3321
trigger1 = time=[10,25]
x = 0.7;*(root,facing)
ignorehitpause = 1
;persistent =


[State 33210, PosSet]
type = PosSet
triggerall = root,stateno=3321
trigger1 = var(4)>1 ; <5
x = IfElse(Facing=1,(root,pos X)+15*var(4)+56,(root,pos X)-15*var(4)-56) ;9
ignorehitpause = 1


[State 3321, Charge lightning MAX]
type = Explod
triggerall = var(4)=5
trigger1 = !NumExplod(33213)
anim = 33213
ID = 33213
pos = 0,0
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -2
sprpriority = 10
ownpal = 1
bindtime = -1
scale = 1.5,1.5
removeongethit = 1


[State 3331, Sound]
type = PlaySnd
trigger1 = !time
value = 3330,0
loop = 1
channel = 5

[State 3331, Velocity]
type = VelSet
triggerall = var(4)!=0
trigger1 = root,stateno= 3322 && root,time=0
trigger2 = root,stateno!= 3321 ;1 && root,var(4)!=0
x = 0.5**(0.25*var(4)) ;0.45+(1.0/(root,var(4)))

[State 0, DisplayToClipboard]
type = DisplayToClipboard
trigger1 = 1
text = "var(10) = %d  vel x = %f"
params = var(10),vel x
ignorehitpause = 1
;persistent =


[State 33210, anim]
type = null;changeanim
trigger1 = AnimElemNo(0)=((root,var(4))-1)
trigger1 = root,var(4)=root,var(4)
value = 33210
elem = root,var(4)
ignorehitpause = 1

[State 33210, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

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

[State 33210, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 33210, HitOverride]
type = HitOverride
trigger1 = Time >= 0
trigger1 = var(1):=Anim
trigger1 = var(2):=AnimElemno(0)
slot = 1
time = 1
stateno = 33211
attr = SCA, NP, SP, HP
ignorehitpause = 1

[State 3331, VarAdd]   ; Adjust # of life points on spawn
type = null;ParentVarAdd
trigger1 = !time
trigger1 = PrevStateNo != 33211
ignorehitpause = 1
persistent = 0
var(35) = -1

[State 33210, VarAdd]   ; Track # of life points
type = ParentVarAdd
triggerall = !time
triggerall = !MoveContact
trigger1 = enemynear,movetype!=H
trigger2 = !numtarget
ignorehitpause = 1
persistent = 0
var(35) = 1

[State 33210, VarAdd]   ; Check # of hits
type = ParentVarAdd
triggerall = MoveHit || MoveContact
trigger1 = enemynear,movetype=H
trigger2 = numtarget ;&& (target,movetype=H)
trigger3 = enemy,name="Canine Carrier";dirty hack against Sentro
ignorehitpause = 1
persistent = 0
var(36) = 1

[State 33210, hit]
type = hitdef
triggerall = root,var(36)<9 ;10
trigger1 = 1
attr = S,HP
hitflag = MAFD
guardflag = MA
priority = 7,Hit
;damage = ceil(2*root,var(4)*root,fvar(12)), ceil(root,var(4)*root,fvar(12))
;damage = ceil(ifElse((root,fvar(11)) * (6*root,var(4)) < 7, 7, (root,fvar(11)) * (6*root,var(4)))), 3*(root,var(4))
damage = ceil(ifElse((root,fvar(11)) * (6*var(4)) < 10, 10, (root,fvar(11)) * (6*var(4)))), 3*(var(4))
getpower = 0,0
givepower = 20,20
pausetime = 8, 8
animtype = Back
air.animtype = Back
fall.animtype = Back
ground.type = High
air.type = Low
ground.hittime = 16
ground.slidetime = 16
guard.hittime = 16
air.hittime = 13
airguard.ctrltime = 16
ground.velocity= -2,0
guard.velocity = -5 ;-9
air.velocity = -5.5,-3.9
airguard.velocity = -5.5, -1.5
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
yaccel = .5
fall=0
air.fall = 1
fall.recover = 0
fall.recovertime = 13
sparkno = -1
guard.sparkno = -1
hitsound   = s1410,2 ;s1000,0
guardsound = S6,0
envshake.time = 16
envshake.ampl = 6
envshake.freq = 100
forcestand = 1
palfx.sinadd=64,64,64,4
palfx.mul=128,128,128
palfx.time=32
p1sprpriority = 5
id=3320

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1


[State 33210, Sparks]
type=explod
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
anim=7020+10*(random%2) ;(var(4)-2)
sprpriority=7
postype=p2
pos=(target,const(size.ground.front)-10)+random%20,-77+random%20;floor(p2dist y)
removetime=-2
ownpal=1
facing=-1
ignorehitpause=1
persistent=0
pausemovetime=100
supermovetime=100

[State 33210, Guard Sparks]
type=explod
trigger1= moveguarded && numtarget
anim=7000
sprpriority=7
postype=p2
pos=(target,const(size.ground.front)-10)+random%20,-77+random%20;floor(p2dist y)
removetime=-2
ownpal=1
facing=-1
ignorehitpause=1
persistent=0
pausemovetime=100
supermovetime=100

[State 2311, Capture Anim]
type = VarSet
trigger1 = movecontact
var(1) = Anim
ignorehitpause = 1
;persistent =

[State 2311, Capture AnimElemno]
type = VarSet
trigger1 = movecontact
var(2) = AnimElemno(0)
ignorehitpause = 1
;persistent =

[State 0, ChangeState] ;Leave screen
type = ChangeState
trigger1 = (pos x!=[-260,260])
trigger2 = enemy, NumExplod(991901) || root,NumExplod(991901) ;cinematic leave
value =33213
ctrl = 0
;anim =
ignorehitpause = 1
;persistent =


[State 33210, end] ;enemy or shield damaged, go to vanish
type = changestate
trigger1 = enemynear,alive=0 ;Stop if Enemy dead
;trigger1 = movecontact
trigger2 = root,var(36)>=9  ;Hits <--- THIS!
;trigger3 = root,var(35)>(8+ceil(2.5*var(4))) ;20  ;HP <--- THIS!
trigger3 = root,var(35)>10 ;Lv1
trigger3 = var(4)=1
trigger4 = root,var(35)>12 ;Lv1.5
trigger4 = var(4)=2
trigger5 = root,var(35)>15 ;Lv2
trigger5 = var(4)=3
trigger6 = root,var(35)>17 ;Lv2.5
trigger6 = var(4)=4
trigger7 = root,var(35)>20 ;Lv3
trigger7 = var(4)=5
trigger8 = root,Anim=3325 &&  root,AnimElemTime(4)>=0 ;new detonation code
value = 33212


[State 33210, end] ;respawn, shield alive
type = changestate
trigger1 = movecontact
;trigger2 = root,var(36) < 4  ;<--- THIS!
value = 33211 ;33211





;-----------------------------------
;[MAJIN]
; BB empty state for respawning
[Statedef 33211]
type = A
physics = N
movetype = I
ctrl = 0
sprpriority = 1
hitcountpersist = 1
;movehitpersist = 1

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


[State 2315, ChangeState]
type = ChangeState
trigger1 = !time ;!time
value = 33210
ctrl = 0
;anim =
;ignorehitpause =
;persistent =


;-----------------------------------------
;[MAJIN]
; Big Bang explod/vanish
[Statedef 33212]
type=A
movetype=A
physics=N
velset=0,0
ctrl=0
sprpriority=5
hitcountpersist = 1
;movehitpersist = 1

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

[State 33212, StopSnd]
type = StopSnd
trigger1 = !time
trigger2 = root,StateNo = 3700							  
channel = 5

[State 0, RemoveExplod MAX]
type = RemoveExplod
trigger1 = !time
id = 33213
ignorehitpause = 1
;persistent =


[State 33212, transparency]
type = Trans
trigger1 = root,var(2)=0
trans = none


[State 33212, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
flag2 = nojugglecheck
;flag3 = invisible
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !time
value = 3336
;elem = 1
ignorehitpause = 1
;persistent =

[State 0, HitDef]
type = HitDef
;trigger1 = enemy, NumExplod(991901)=0 || root,NumExplod(991901)=0 ;No cinematic leave
trigger1 = time>0
attr = SCA,NP,SP,HP        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = MAFD        ;HLAFD+-
guardflag = MA         ;HLA
getpower = 0,0
givepower = 0,0
affectteam = E          ;B,E,F
animtype = diagup          ;light,medium,hard,back,up,diagup
priority = 4,Hit   ;Hit,Miss,Dodge
damage = 60+12*var(4),6+var(4) ;ceil(ifElse((root,fvar(11)) * 200 < 70, 70, (root,fvar(11)) * 200)), 20
pausetime = 0,0
guard.pausetime = 0,0
sparkno = -1
guard.sparkno = -1
sparkxy = 0,0
;hitsound = S2511,0
;guardsound = S2511,0
ground.type = Trip      ;Low,Trip,None
ground.velocity = -5,-8;-5*(enemynear,facing),-2
air.velocity = -5,-8;-5*(enemynear,facing),-2
fall = 1
ignorehitpause = 1
persistent = 0

[State 0, StateTypeSet] ;stop blocking
type = StateTypeSet
trigger1 =  AnimElem>=4
movetype = I
ignorehitpause = 1
;persistent =

[State 0, AttackDist] ;stop blocking
type = AttackDist
trigger1 =  AnimElem>=4
value = 0
ignorehitpause = 1
;persistent =

[State 33212, Projectile]
type = null;Projectile
triggerall =  !NumProjID(3335)
trigger1 = !time
ProjID =  3335
projanim = 3336
projhitanim = 3336
projremovetime = 36 ;-1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
velmul = 1
projhits = 1
projpriority = 1
projsprpriority = 4
projedgebound = 40
projstagebound = 40
projheightbound = -240
offset = 0,0
postype = p1         ;p2,front,back,left,right
projshadow = 0,0,0
supermovetime = 0
pausemovetime = 0
; HitDef
attr = SCA,NP,SP,HP        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = MAFD        ;HLAFD+-
guardflag = MA         ;HLA
getpower = 0,0
givepower = 0,0
affectteam = B          ;B,E,F
animtype = diagup          ;light,medium,hard,back,up,diagup
priority = 4,Hit   ;Hit,Miss,Dodge
;damage = 200,20
;damage = ceil(ifElse((root,fvar(11)) * 200 < 7, 7, (root,fvar(11)) * 200)), 20
damage = ceil(ifElse((root,fvar(11)) * 200 < 70, 70, (root,fvar(11)) * 200)), 20
pausetime = 0,0
guard.pausetime = 0,0
sparkno = 0
guard.sparkno = 0
sparkxy = 0,0
;hitsound = S2511,0
;guardsound = S2511,0
ground.type = Trip      ;Low,Trip,None
ground.velocity = -5,-2
air.velocity = -5,-2
fall = 1


[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[State 33212, Sound]
type = PlaySnd
trigger1 = !time
value = 3330, 1
channel = 5

[State 33212, nothitby]
type = nothitby
trigger1 = 1
time = 1
value = SCA
ignorehitpause = 1

[State 33212, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 33212, End with Zzyzzyxx fix]
type= null ;destroyself
;triggerall = !animtime
trigger1 = enemynear,alive=0 ;Stop if Enemy dead
trigger2 = !numtarget
trigger3 = numtarget
trigger3 = target, time <= 1 && !(target, hitshakeover)
trigger4 = !animtime; && root,var(35) = 11
;trigger4 = root,var(35) = 10
;trigger5 = root,movetype=H
trigger5 = root,var(36)=9
trigger6 = root,StateNo = 3700

[State 0, DestroySelf]
type = DestroySelf
trigger1 = !animtime
ignorehitpause = 1
;persistent =

;-----------------------------------------
;[MAJIN]
; Big Bang LEAVE
[Statedef 33213]
type=A
movetype=I
physics=N
velset=0,0
ctrl=0
sprpriority=5
hitcountpersist = 1
;movehitpersist = 1

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

[State 33212, StopSnd]
type = StopSnd
trigger1 = !time
trigger2 = root,StateNo = 3700
channel = 5

[State 0, RemoveExplod MAX]
type = RemoveExplod
trigger1 = !time
id = 33213
ignorehitpause = 1
;persistent =

[State 33212, transparency]
type = Trans
trigger1 = root,var(2)=0
trans = none

[State 33212, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
flag2 = nojugglecheck
;flag3 = invisible
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !time
value = 3336
;elem = 1
ignorehitpause = 1
;persistent =

[State 0, AngleDraw]
type = AngleDraw
trigger1 = 1
;value = 1
scale = 0.5,0.5
ignorehitpause = 1
;persistent =

[State 33212, Sound]
type = PlaySnd
trigger1 = !time
value = 3330, 1
channel = 5

[State 33212, nothitby]
type = nothitby
trigger1 = 1
time = 1
value = SCA
ignorehitpause = 1

[State 33212, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 0, DestroySelf]
type = DestroySelf
trigger1 = !animtime
ignorehitpause = 1
;persistent =

;-------------------------------------------------------------------------------
;[MAJIN]
; AIR PHOTON BOMBER HELPER
[Statedef 3362]
type = A
movetype = A
physics = N
ctrl = 0
sprpriority = 10

[State 1061, Rotate]
type = AngleDraw
trigger1 = 1
value = -60 ;-45
ignorehitpause = 1

[State 3302, anim]
type = changeanim
trigger1 = !time
value = 3302

[State 3302, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
;flag2 = invisible
ignorehitpause = 1

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

[State 3302, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 3302, HitOverride]
type = HitOverride
;trigger1 = 1
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 33021
attr = SCA, NP, SP, HP
ignorehitpause = 1


[State 3302, Velocity]
type = VelSet
trigger1 = !time
x = 4
y = 10

[State 3302, hit]
type = hitdef
trigger1 = 1
attr = S,HP
hitflag = MAFD
guardflag = MA
priority = 7,Hit
;damage = 30,3
;damage = ceil(ifElse((root,fvar(11)) * 30 < 7, 7, (root,fvar(11)) * 30)), 3
damage = ceil(ifElse((root,fvar(11)) * 30 < 10, 10, (root,fvar(11)) * 30)), 3
getpower = 0,0
givepower = 20,20
pausetime = 8, 8
animtype = Back
air.animtype = Back
fall.animtype = Back
ground.type = High
air.type = Low
ground.hittime = 16
ground.slidetime = 16
guard.hittime = 16
air.hittime = 13
airguard.ctrltime = 16
ground.velocity= 2,0
guard.velocity = 2 ;-9
air.velocity = -5.5,-3.9
airguard.velocity = -5.5, -1.5
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
yaccel = .5
fall=0
air.fall = 1
fall.recover = 0
fall.recovertime = 13
sparkno = -1
hitsound   = s1000,0
guardsound = S6,0
envshake.time = 16
envshake.ampl = 6
envshake.freq = 100
forcestand = 1
palfx.sinadd=64,64,64,4
palfx.mul=128,128,128
palfx.time=32
p1sprpriority = 5
persistent=0

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[State 3302, Sparks]
type=explod
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
anim=7020
sprpriority=7
postype=p2
pos=(target,const(size.ground.front)-2),-62 ;-77;floor(p2dist y)
removetime=-2
ownpal=1
facing=-1
ignorehitpause=1
persistent=0
pausemovetime=100
supermovetime=100

[State 3302, Guard Sparks]
type=explod
trigger1= moveguarded
anim=7010
sprpriority=7
postype=p2
pos=(target,const(size.ground.front)-2),-62 ;-77;floor(p2dist y)
removetime=-2
ownpal=1
facing=-1
ignorehitpause=1
persistent=0
pausemovetime=100
supermovetime=100

[State 3302, Helper Limiter]
type = Helper
triggerall = !NumHelper(9999)
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
helpertype = normal
name = "Limiter"
ID = 9999
stateno = 9999
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1


[state 3302, Flame overlay]
type = helper
triggerall = !NumHelper(9990)
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
trigger1 = target,IsHelper=0
pos = 0,0
postype = left
ID = 9990
stateno = 9990
helpertype = normal
name = "Fire"
sprpriority = -5
ownpal = 1
ignorehitpause = 1

[State 3302, end]   ;Floor impact
type = changestate
trigger1 = pos Y >= -10
value = 3363

[State 3302, end]   ;Contact
type = changestate
trigger1 = movecontact
value = 33021

[State 3302, End]
type = destroyself
trigger1 = pos x!=[-240,240]
trigger2 = pos Y >= 0

;-----------------------------------------
;[MAJIN]
; AIR PB ground vanish
[Statedef 3363]
type=A
movetype=A
physics=N
velset=0,0
ctrl=0
sprpriority=10

[State 1061, Rotate]
type = AngleDraw
trigger1 = 1
value = 0
ignorehitpause = 1

[State 33021, anim]
type = changeanim
trigger1 = !time
value = 3303


[State 33021, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
flag2 = nojugglecheck
;flag3 = invisible
ignorehitpause = 1


[State 33021, Sound]
type = PlaySnd
trigger1 = !time
value = 3300, 1

[State 33021, nothitby]
type = nothitby
trigger1 = 1
time = 1
value = SCA
ignorehitpause = 1

[State 33021, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 3010, Helper 1]
type = Helper
trigger1 = time=18
helpertype = normal
name = "BKH Ball 1"
ID =   3020
stateno = 3022
pos = 0,50 ;IfElse(FrontEdgeDist<105,45,75),0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0


[State 33021, NoShadow]
type = AssertSpecial
trigger1 = time>=21
flag = invisible
ignorehitpause = 1

[State 3010, Helper 2]
type = Helper
trigger1 = time=30
helpertype = normal
name = "BKH Ball 2"
ID =   3020
stateno = 3022
pos = 30,20 ;IfElse(FrontEdgeDist<105,45,125),0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0

[State 3010, Helper 3]
type = Helper
trigger1 = time=30
helpertype = normal
name = "BKH Ball 3"
ID =   3020
stateno = 3022
pos = -30,20 ;IfElse(FrontEdgeDist<105,45,175),0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0

[State 3010, Helper 4]
type = Helper
trigger1 = time=40
helpertype = normal
name = "BKH Ball 4"
ID =   3020
stateno = 3022
pos = 0,10 ;IfElse(FrontEdgeDist<105,45,75),0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0

[State -2, Special Projectile]
type = Projectile
triggerall = root,NumProjID(3410)=0
trigger1 = root,winKO=1
ProjID = 3410
projanim = 9999
projremovetime = 10
postype = p2
offset = 0, -30
attr = A, NP
hitflag = MAF
guardflag =
pausetime = 0, 0
sparkno = -1
hitsound = -1
numhits = 0

[State 33021, End with Zzyzzyxx fix]
type= destroyself
;triggerall = !animtime
trigger1 = time >= 54
trigger2 = !animtime
;trigger2 = !numtarget
;trigger3 = numtarget
;trigger3 = target, time <= 1 && !(target, hitshakeover)

;-------------------------------
;[MAJIN]
;MACHINE GUN TANTRUM HELPER
[Statedef 3410]
type    = S
movetype= A
physics = N
anim = 1010
sprpriority = 5
hitcountpersist = 1
movehitpersist = 1

[State 3410, gethit gut ?]
type = VarSet
trigger1 = !time
var(14) = root,var(14)

[State 3410, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 3410, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 3410, NoJuggle]
type = parentvarset
trigger1 = time = 0
var(18) = 1

[State 3410, Velocity]
type = VelSet
trigger1 = Time = 0
x = 17 ;16 ;8
y = 0.0 + Tan(random%2) - Tan(random%2)

[State 3410, Velocity]
type = VelSet
trigger1 = Movehit
x = 0

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

[State 3410, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 3410, HitOverride]
type = HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 1030
attr = SCA, AA, AP, AT
ignorehitpause = 1

[State 3410, Hitdef]
type = HitDef
trigger1 = var(14)=0
attr = S, HP
animtype  = hard
;damage    = ceil(17*root,fvar(12)), ceil(4*root,fvar(12))
;damage = ceil(ifElse((root,fvar(11)) * 17 < 12, 4, (root,fvar(11)) * 17)), 4
damage = ceil(ifElse((root,fvar(11)) * 17 < 7, 7, (root,fvar(11)) * 17)), 4
priority  = 4,Hit
guardflag = MA
hitflag = MAF
pausetime = 0,10
sparkno = S3435 ;s7010
guard.sparkno = -1
sparkxy = 0,0
hitsound   = s1410,1 ;s1000,0
guardsound = S6,1
ground.type = high
air.type = low
ground.slidetime = 20 ;15
ground.hittime  = 25 ;15
ground.velocity = -7.8,0
guard.velocity = -7.5
air.velocity = -5.8,-3
airguard.velocity = -5, -4
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
air.fall = 0
fall.recover = 1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = 0,0  ;ifelse(p2movetype=H,40,140), 10
givepower = 35,35

[State 3410, Hitdef]
type = HitDef
trigger1 = var(14)=1
attr = S, HP
animtype  = hard
;damage    = ceil(17*root,fvar(12)), ceil(4*root,fvar(12))
;damage = ceil(ifElse((root,fvar(11)) * 17 < 12, 4, (root,fvar(11)) * 17)), 4
damage = ceil(ifElse((root,fvar(11)) * 17 < 7, 7, (root,fvar(11)) * 17)), 4
priority  = 4,Hit
guardflag = MA
hitflag = MAF
pausetime = 0,10
sparkno = S3435 ;s7010
guard.sparkno = -1
sparkxy = 0,0
hitsound   = s1000,0
guardsound = S6,1
ground.type = low
air.type = low
ground.slidetime = 20 ;15
ground.hittime  = 25 ;15
ground.velocity = -7.8,0
guard.velocity = -7.5
air.velocity = -5.8,-3
airguard.velocity = -5, -4
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
air.fall = 0
fall.recover = 1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = 0,0  ;ifelse(p2movetype=H,40,140), 10
givepower = 35,35

[State -2, Special Projectile]
type = Projectile
;trigger1 = movehit
;trigger1 = numtarget
;trigger1 = target,alive=0
triggerall = root,NumProjID(3410)=0
trigger1 = root,winKO=1
ProjID = 3410
projanim = 9999
projremovetime = 10
postype = p2
offset = 0, -30
attr = A, NP
hitflag = MAF
guardflag =
pausetime = 0, 0
sparkno = -1
hitsound = -1
numhits = 0

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[State 3410, Guardshake]
type = envshake
trigger1 = moveguarded
time = 4
ampl = 6
freq = 176
ignorehitpause = 1

[State 3410, NoJuggle]
type = parentvarset
trigger1 = movecontact
var(18) = 0

[State 3410, End]
type = destroyself
trigger1 = (pos x!=[-240,240])
trigger2 = time>180

[State 3410, Fade]
type = changestate
trigger1 = movecontact
value = 3411
ignorehitpause=1

;----------------------------------------------------
;[MAJIN]
;MACHINE GUN TANTRUM PROJECTILE HELPER VANISHES
[Statedef 3411]
type    = A
movetype= A
physics = N
anim = 1013
sprpriority = 5
velset = -2,0

[State 3411, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 3411, NoJuggle Safety]
type = parentvarset
trigger1 = !time
var(18) = 0

[State 3411, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 3411, End]
type = destroyself
trigger1 = animtime = 0

;----------------------------------------------------
;[MAJIN]
;AIR MACHINE GUN TANTRUM HELPER
[Statedef 3431]
type    = A ;S
movetype= A
physics = N
anim = 1010
sprpriority = 5
hitcountpersist = 1
movehitpersist = 1

[State 1061, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 1061, transparency]
type = Trans
trigger1 = root,var(2)=1
trans = addalpha
alpha = 200,128
ignorehitpause = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = time = 0
var(18) = 1

[State 1061, Turn]
type = AngleDraw
trigger1 = 1
value = -90

[State 1061, Velocity]
type = VelSet
trigger1 = Time = 0
x = 0.0 + Tan(random%2) - Tan(random%2)
y = 13 ;12 ;8

[State 1061, Velocity]
type = VelSet
trigger1 = Movehit
y = 0

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

[State 1061, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 1061, HitOverride]
type = HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 1030
attr = SCA, AA, AP, AT
ignorehitpause = 1

[State 1061, Hitdef]
type = HitDef
trigger1 = 1
attr = A, HP
animtype  = hard
;damage    = ceil(16*root,fvar(12)), ceil(2*root,fvar(12))
;damage = ceil(ifElse((root,fvar(11)) * 16 < 12, 4, (root,fvar(11)) * 16)), 2
damage = ceil(ifElse((root,fvar(11)) * 16 < 7, 7, (root,fvar(11)) * 16)), 2
priority  = 4,Hit
guardflag = HA ;MA
hitflag = MAFD
pausetime = 0,10
guard.pausetime = 2,1
sparkno = S3435 ;s7010
guard.sparkno = -1
sparkxy = 0,0
hitsound   = s1000,0; s1410,1 ;s1000,0
guardsound = S6,1
ground.type = Low ;high
air.type = low
ground.slidetime = 20 ;15
ground.hittime  = 25 ;15
guard.slidetime = 7
guard.hittime  = 7
ground.velocity = -2,0
guard.velocity = -2
air.velocity = -2,2 ;5
airguard.velocity = -2, 2
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
;fall = 1
;forcenofall = 1
down.bounce = 1
air.fall = 0
fall.recover = 0
fall.recovertime = 10
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = 0,0  ;ifelse(p2movetype=H,40,140), 10
givepower = 35,35

[State -2, Special Projectile]
type = Projectile
;trigger1 = movehit
;trigger1 = numtarget
;trigger1 = target,alive=0
triggerall = root,NumProjID(3410)=0
trigger1 = root,winKO=1
ProjID = 3410
projanim = 9999
projremovetime = 10
postype = p2
offset = 0, -30
attr = A, NP
hitflag = MAF
guardflag =
pausetime = 0, 0
sparkno = -1
hitsound = -1
numhits = 0

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[State 3001, Guardshake]
type = envshake
trigger1 = moveguarded
time = 4
ampl = 6
freq = 176
ignorehitpause = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = movecontact
var(18) = 0

[State 1061, End]
type = destroyself
trigger1 = (pos y!=[-10000,240])
trigger2 = time>180

[State 3055, end]
type = PlaySnd
trigger1 = pos y >= 0
value = 1410,0
persistent = 0

[State 1061, Fade]
type = changestate
trigger1 = movecontact
trigger2 = pos Y >= 0
value = 1630
ignorehitpause=1

;-------------------------------
;[MAJIN]
;SPB HELPER CHARGE
[Statedef 37000]
type    = S
movetype= A
physics = N
anim = 3710
sprpriority = 5
hitcountpersist = 1
movehitpersist = 1

[State 3400, 1]
type = PlaySnd
trigger1 = !time
value = 2614,0
channel = 5
volume = -100

[State 37000, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 37000, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 37000, NotHitBy]
type = NotHitBy
trigger1 = Time >= 0
time = 1
value = SCA ;, NA, SA, HA, NT, ST, HT
ignorehitpause = 1

[State 37000, HitBy]
type = null ;HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 37000, HitOverride]
type = null ;HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 1030
attr = SCA, AA, AP, AT
ignorehitpause = 1

[State 37000, End]
type = destroyself
trigger1 = (pos x!=[-240,240])
trigger2 = time>180

[State 37000, To Launch]
type = changestate
trigger1 = !Animtime
value = 37001
ignorehitpause=1

;[MAJIN]
;SPB HELPER LAUNCH
[Statedef 37001]
type    = S
movetype= A
physics = N
anim = 3711
sprpriority = 5
hitcountpersist = 1
movehitpersist = 1

[State 37001, StopSnd]
type = StopSnd
trigger1 = !time
channel = 5
;ignorehitpause =
;persistent =


[State 37001, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 37001, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 37001, NotHitBy]
type = NotHitBy
trigger1 = Time >= 0
time = 1
value = SCA ;, NA, SA, HA, NT, ST, HT
ignorehitpause = 1

;----------------------
;Aimed projectile, based on code made by Bea

;Finds the X component of the vector Player, EnemyNear
;Formula to find the components of a given vector AB
;V(x) = B(x) - A(x)
;V(y) = B(y) - A(y)
[State 1640, X]
Type = VarSet
Trigger1 = 1
fvar(1) = (EnemyNear(0),Pos X - Pos X) * Facing ;Adjust the direction towards player facing
;Finds the Y component of the vector Player, EnemyNear
[State 1640, Y 0]
Type = VarSet
trigger1 = 1
fvar(2) = (EnemyNear(0),Const(size.head.pos.y) - Pos Y)
[State 1640, Y 1]
Type = VarSet
trigger1 = 1
fvar(3) = -10.0+(EnemyNear(0),Pos Y - Pos Y);bottom
[State 1640, Y 2]
Type = VarSet
trigger1 = 1
fvar(4) = (EnemyNear(0),Const(size.mid.pos.y) - Pos Y)
[State 1640, Y 3]
Type = VarSet
trigger1 = 1
fvar(5) = 10.0+(EnemyNear(0),Const(size.mid.pos.y) - Pos Y)
[State 1640, Y 4]
Type = VarSet
trigger1 = 1
fvar(6) = -10.0+(EnemyNear(0),Const(size.head.pos.y) - Pos Y)  ;top

;Finds the vector length
;Formula of the length of a given vector AB
;|AB| = (AB(x)^2  + AB(y)^2)^1/2
[State 1640, Vector Length 0]
Type = VarSet
trigger1 = 1
fvar(7) = Exp(0.5*ln((fvar(1) * fvar(1))+(fvar(2) * fvar(2))))
[State 1640, Vector Length 1]
Type = VarSet
trigger1 = 1
fvar(8) = Exp(0.5*ln((fvar(1) * fvar(1))+(fvar(3) * fvar(3))))
[State 1640, Vector Length 2]
Type = VarSet
trigger1 = 1
fvar(9) = Exp(0.5*ln((fvar(1) * fvar(1))+(fvar(4) * fvar(4))))
[State 1640, Vector Length 3]
Type = VarSet
trigger1 = 1
fvar(10) = Exp(0.5*ln((fvar(1) * fvar(1))+(fvar(5) * fvar(5))))
[State 1640, Vector Length 4]
Type = VarSet
trigger1 = 1
fvar(11) = Exp(0.5*ln((fvar(1) * fvar(1))+(fvar(6) * fvar(6))))

[State 37001, Velocity 0]
type = VelSet
trigger1 = IsHelper(37000)
trigger1 = Time = 0
x = (Fvar(1)/fvar(7)) * 10.0
y = (FVar(2)/fvar(7)) * 10.0
[State 37001, Velocity 1]
type = VelSet
trigger1 = IsHelper(37001)
trigger1 = Time = 0
x = (Fvar(1)/fvar(8)) * 10.0
y = (FVar(3)/fvar(8)) * 10.0
[State 37001, Velocity 2]
type = VelSet
trigger1 = IsHelper(37002)
trigger1 = Time = 0
x = (Fvar(1)/fvar(9)) * 10.0
y = (FVar(4)/fvar(9)) * 10.0
[State 37001, Velocity 3]
type = VelSet
trigger1 = IsHelper(37003)
trigger1 = Time = 0
x = (Fvar(1)/fvar(10)) * 10.0
y = (FVar(5)/fvar(10)) * 10.0
[State 37001, Velocity 4]
type = VelSet
trigger1 = IsHelper(37004)
trigger1 = Time = 0
x = (Fvar(1)/fvar(11)) * 10.0
y = (FVar(6)/fvar(11)) * 10.0
;Normalizes the components
;and multiply by the desired absolute velocity.
;----------------------

[State 37001, launch sound]
type = PlaySnd
trigger1 = !time
value = 10,0
volume = -100

[State 37001, End]
type = destroyself
trigger1 = (pos x!=[-240,240])
trigger2 = time>180

[State 37001, To Attach]
type = changestate
trigger1 = P2Dist X<=random%5; P2Dist X<= 0;!Animtime
value = 37002
ignorehitpause=1

;[MAJIN]
;SPB HELPER ATTACHMENT
[Statedef 37002]
type    = S
movetype= A
physics = N
anim = 3713
velset = 0,0
sprpriority = 4
hitcountpersist = 1
movehitpersist = 1

[State 37002, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 1000,0
volume = -100
channel = -1

[State 37002, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 37002, NotHitBy]
type = NotHitBy
trigger1 = Time >= 0
time = 1
value = SCA ;, NA, SA, HA, NT, ST, HT
ignorehitpause = 1

[State 37002, HitBy]
type = null ;HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 37002, HitOverride]
type = null ;HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 1030
attr = SCA, AA, AP, AT
ignorehitpause = 1

[State 37002, End]
type = destroyself
trigger1 = root,stateno!=[3701,3703]  ;SPB
trigger1 = root,stateno!=[37021,37031] ;SPB
trigger1 = root,stateno!=4000 ;Sanity FF
trigger2 = enemy,stateno=3706 ;Hit by SPB AB
trigger3 = time>400
trigger4 = (pos x!=[-240,240])


;----------------------------------------------------
;[MAJIN]
;------------------------------------------------
; SPB Horizontal Lines BG
[Statedef 37010]
type = A
movetype = A
physics = N
anim = 15999
velset = 0,0

[State 2260, push]
type = PlayerPush
trigger1 = Time >= 0
value = 0

[State 2260, muteki]
type = NotHitBy
trigger1 = 1
value = SCA

[State 2260, bg]
type = assertspecial
trigger1 = 1
flag = noFG
flag2 = noBG
flag3 = nobardisplay
ignorehitpause = 1

[State 2260, flash]
type = PalFX
trigger1 = TimeMod = 4,0
trigger1 = 1
time = 1
invertall = 1
ignorehitpause = 0

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

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

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = root,stateno=[4100,4150]   ;Galactic Juggle
trigger2 = root,stateno=3801          ;Aura Burst
trigger3 = root,stateno=3810          ;Sanity Aura Burst
trigger4 = root,stateno=4002          ;Sanity Final Flash
trigger5 = enemy,stateno=5100         ;P2 End of SPB
trigger6 = enemy,Alive=0              ;Remove if enemy is dead
trigger7 = NumTarget
trigger7 = target,stateno=5100        ;P2 End of SPB
trigger8 = NumTarget
trigger8 = target,Alive=0             ;Remove if enemy is dead
trigger9 = root,stateno=0             ;P1 End of SPB
id =  2923
;ignorehitpause =
;persistent =


[State 2260, destroy]
type = DestroySelf
trigger1 = root,stateno=[4100,4150]   ;Galactic Juggle
trigger2 = root,stateno=3801          ;Aura Burst
trigger3 = root,stateno=3810          ;Sanity Aura Burst
trigger4 = root,stateno=4002          ;Sanity Final Flash
trigger5 = enemy,stateno=5100         ;P2 End of SPB
trigger6 = enemy,Alive=0              ;Remove if enemy is dead
trigger7 = NumTarget
trigger7 = target,stateno=5100        ;P2 End of SPB
trigger8 = NumTarget
trigger8 = target,Alive=0             ;Remove if enemy is dead
trigger9 = root,stateno=0             ;P1 End of SPB

;-------------------------------
;[MAJIN]
;Particle Generator
[Statedef 3812]
type    = S
movetype= I
physics = N
anim = 9999
sprpriority = 6

[State 3812, AssertSpecial]
type = AssertSpecial
trigger1 =  1
flag = invisible
ignorehitpause = 1

[State 3812, BindToRoot]
type = BindToRoot
trigger1 =  1
time = 1
;facing = 0
pos = 0,-50
ignorehitpause = 1
;persistent =


[State 3812, Particles P1 A]
type = Helper
triggerall = gametime%5=0
trigger1 = NumHelper(38121)<8 ;4
name = "Particles"
postype = P1
pos = -25+random%10, -20-random%10 ;10.0*cos(random),10.0*cos(random) ;1, 0
ownpal = 1
helpertype = normal
stateno = 38121
id = 38121
size.xscale = 1 ;cos(random) ;1
size.yscale = 1 ;cos(random) ;1
ignorehitpause = 1

[State 3812, Particles P1 B]
type = Helper
triggerall = gametime%7=0
trigger1 = NumHelper(38121)<8 ;4
name = "Particles"
postype = P1
pos = 10+random%10, -23-random%10 ;10.0*cos(random),10.0*cos(random) ;1, 0
ownpal = 1
helpertype = normal
stateno = 38121
id = 38121
size.xscale = -1 ;cos(random) ;1
size.yscale = 1 ;cos(random) ;1
ignorehitpause = 1

[State 3812, Particles P1 C]
type = Helper
triggerall = gametime%9=0
trigger1 = NumHelper(38121)<8 ;4
name = "Particles"
postype = P1
pos = 23+random%10, -14-random%10 ;10.0*cos(random),10.0*cos(random) ;1, 0
ownpal = 1
helpertype = normal
stateno = 38121
id = 38121
size.xscale = cos(random) ;1
size.yscale = 1 ;cos(random) ;1
ignorehitpause = 1


[State 3812, Particles P2 A]
type = Helper
triggerall = gametime%5=0
trigger1 = NumHelper(38122)<8 ;4
name = "Particles"
postype = P2
pos = -15+random%10, -25-random%10 ;10.0*cos(random),10.0*cos(random) ;1, 0
ownpal = 1
helpertype = normal
stateno = 38122
id = 38122
size.xscale = 1 ;cos(random) ;1
size.yscale = 1 ;cos(random) ;1
ignorehitpause = 1

[State 3812, Particles P2 B]
type = Helper
triggerall = gametime%7=0
trigger1 = NumHelper(38122)<8 ;4
name = "Particles"
postype = P2
pos = 4+random%10, -43-random%10 ;10.0*cos(random),10.0*cos(random) ;1, 0
ownpal = 1
helpertype = normal
stateno = 38122
id = 38122
size.xscale = cos(random) ;1
size.yscale = 1 ;cos(random) ;1
ignorehitpause = 1

[State 3812, Particles P2 C]
type = Helper
triggerall = gametime%9=0
trigger1 = NumHelper(38122)<8 ;4
name = "Particles"
postype = P2
pos = 13+random%10, -34-random%10 ;10.0*cos(random),10.0*cos(random) ;1, 0
ownpal = 1
helpertype = normal
stateno = 38122
id = 38122
size.xscale = -1 ;cos(random) ;1
size.yscale = 1 ;cos(random) ;1
ignorehitpause = 1

[State 3812, DestroySelf]
type = DestroySelf
trigger1 = time=90 ;180
ignorehitpause = 1
;persistent =

;-------------------------------
;[MAJIN]
;Particles P1
[Statedef 38121]
type    = S
movetype= I
physics = N
;anim = 3812
sprpriority = 6

[State 38121, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1
;persistent =


[State 38121, ChangeAnim]
type = ChangeAnim
trigger1 = !time
value = 3812+random%3
;elem = 1
;ignorehitpause =
;persistent =


[State 38121, PalFX]
type = null ;PalFX
trigger1 = !time
time = -1
add = 240,41,240
mul = 250,224,250
sinadd = 85,55,110,8
invertall = 0
color = 128
ignorehitpause = 1
;persistent = 1

[State 38121, VelSet]
type = VelSet
trigger1 = !time
x = cos(random)
y = -1.0*(random/1000)
ignorehitpause = 1
;persistent =


[State 38121, Velocity]
type = VelAdd
trigger1 = 1
x = -0.05
y = -0.3*(time/10.0) ;-1.0*(time/10.0) ;-2.0*sin(pi)
ignorehitpause = 1
;persistent =

[State 38121, Offset]
type = Offset
trigger1 = 1
x = 5.0*cos(time)
ignorehitpause = 1


[State 38121, DestroySelf]
type = DestroySelf
trigger1 = !animtime ;time=(6+random%6)
trigger2 = pos y!=[-240,0]
ignorehitpause = 1
;persistent =

;-------------------------------
;[MAJIN]
;Particles P2
[Statedef 38122]
type    = S
movetype= I
physics = N
;anim = 3812
sprpriority = 6

[State 38121, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1
;persistent =


[State 38121, ChangeAnim]
type = ChangeAnim
trigger1 = !time
value = 3812+random%3
;elem = 1
;ignorehitpause =
;persistent =


[State 38121, PalFX]
type = null ;PalFX
trigger1 = !time
time = -1
add = 240,41,240
mul = 250,224,250
sinadd = 85,55,110,8
invertall = 0
color = 128
ignorehitpause = 1
;persistent = 1

[State 38121, VelSet]
type = VelSet
trigger1 = !time
x = cos(random)
y = -1.0*(random/1000)
ignorehitpause = 1
;persistent =


[State 38121, Velocity]
type = VelAdd
trigger1 = 1
x = -0.05
y = -0.3*(time/10.0) ;-1.0*(time/10.0) ;-2.0*sin(pi)
ignorehitpause = 1
;persistent =

[State 38121, Offset]
type = Offset
trigger1 = 1
x = 5.0*cos(time)
ignorehitpause = 1


[State 38121, DestroySelf]
type = DestroySelf
trigger1 = !animtime ;time=(6+random%6)
trigger2 = pos y!=[-240,0]
ignorehitpause = 1
;persistent =



;-------------------------------
;[MAJIN]
;AURA BURST
[Statedef 38000]
type    = S
movetype= A
physics = N
anim = 3811
sprpriority = 0 ;3 ;-5
hitcountpersist = 1
movehitpersist = 1

[State 0, BindToRoot]
type = BindToRoot
trigger1 = 1
time = 1
;facing = 0
pos = 10,10
;ignorehitpause =
;persistent =

[State 38000, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 38000, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

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


[State 38000, End]
type = destroyself
trigger1 = root,var(58)<=0 && time>15
trigger2 = (pos x!=[-240,240])
trigger3 = root,Anim!=3802 ;time>180
;trigger4 = enemynear,Alive=0
;trigger5 = time>180

;-------------------------------
;[MAJIN]
;AURA SHIELD (Danger Zone)
[Statedef 38001]
type    = S
movetype= A
physics = N
anim = 3815
sprpriority = 0 ;3 ;-5
hitcountpersist = 1
movehitpersist = 1

[State 38001, BindToRoot]
type = BindToRoot
trigger1 = 1
time = 1
;facing = 0
pos = 0,0
;ignorehitpause =
;persistent =

[State 38001, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow


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

[State 38001, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 38001, HitOverride]
type = HitOverride
;trigger1 = 1
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 38001
attr = SCA, NP, SP, HP
ignorehitpause = 1

[State 38001, End]
type = destroyself
trigger1 = !NumHelper(38000)



;-------------------------------
;[MAJIN]
;SANITY AURA BURST
[Statedef 38010]
type    = S
movetype= A
physics = N
anim = 3822
sprpriority = 3 ;-5
hitcountpersist = 1
movehitpersist = 1

[State 0, BindToRoot]
type = null ;BindToRoot
trigger1 = 1
time = 1
;facing = 0
pos = 0,0
;ignorehitpause =
;persistent =

[State 38000, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 38000, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

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


[State 38000, End]
type = destroyself
trigger1 = (pos x!=[-240,240])
trigger2 = root,stateno!=3822 ;3810 ;time>180
trigger3 = enemynear,Alive=0
;trigger4 = root,var(58)<=0 ;time>180
;trigger4 = time>50

;------------------------------------------------------
;Rocks going up

[Statedef 38020]
type = A
movetype = I
physics = N
anim = 15999

[State 1003, Helper]
type = Helper
trigger1 = !time
helpertype = Normal
name = "rocks"
id = 38021
pos = ((random%320)),10*(random%13)
postype = left
facing = 1
stateno = 38021
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1
size.xscale = .5
size.yscale = .5

[State 1003, Helper]
type = Helper
trigger1 = !time
helpertype = Normal
name = "rocks"
id = 38021
pos = ((random%320)+320),10*(random%13)
postype = left
facing = 1
stateno = 38021
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1
size.xscale = .5
size.yscale = .5

[State 1003, Helper]
type = Helper
trigger1 = !time
helpertype = Normal
name = "rocks"
id = 38021
pos = ((random%320)-320),10*(random%13)
postype = left
facing = 1
stateno = 38021
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1
size.xscale = .5
size.yscale = .5

[State 1003, DestroySelf]
type = DestroySelf
trigger1 = time=2

;-----------------
;Rocks
[Statedef 38021]
type = A
movetype = I
physics = N
;anim = 15999 ;19890 + random%6
anim = 19890 + random%6
sprpriority = 10 ;-5

[State 0, Explod]
type = null ;Explod
trigger1 = !time
anim = 19890 + random%6
ID =  38021
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = IfElse(random<500,1,-1)
vfacing = IfElse(random<500,1,-1)
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
pausemovetime = 0
scale = 1,1
sprpriority = 0
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 0
;ignorehitpause =
;trans =
;persistent =
;supermove = 0
;pausemove = 0

[State 1004, assert]
type = assertspecial
trigger1 = 1
flag = noshadow

[State 1004, vel]
type = velset
trigger1 = !time
y = -3-random%7

[State 1004, vel]
type = varset
trigger1 = !time
var(10) = random%2

[State 1004, assert]
type = angledraw
trigger1 = 1
value = ifelse(var(10)=0,5*time,-5*time)

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = time > 400
trigger2 = pos Y < -340
trigger3 = root,stateno = 180
trigger4 = root,stateno = 3840
id = 38021
;ignorehitpause =
;persistent =

[State 1004, DestroySelf]
type = DestroySelf
trigger1 = time > 400
trigger2 = pos Y < -340
trigger3 = root,stateno = 180
trigger4 = root,stateno = 3840

;===================================================
;SANITY FF BEAM
[Statedef 4004]
type = A
physics = N
movetype = A
;anim = 2504
ctrl = 0
sprpriority = 5
hitcountpersist = 1

[State 1061, NoJuggle]
type = parentvarset
trigger1 = time = 0
var(18) = 1

[State 1061, Bind]
type = bindtoroot
trigger1 = 1
pos = 45, -58
ignorehitpause = 1

[State 8000, Assert]
type=assertspecial
trigger1= 1
flag=noshadow
ignorehitpause = 1


[State 1061, Transparency]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 3005, anim]
type = changeanim
trigger1 = !time && !prevstateno && !movecontact
value = 2504

[State 0, Wave FX]
type = Explod
triggerall = !NumExplod(2505)
trigger1 = !time
anim = 2505
id = 2505
pos = -5,0
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -1
sprpriority = 6
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0

[State 3005, anim]
type = null ;AngleDraw
trigger1 = 1
scale = 1.5,1

[State 3005, hit]
type = hitdef
trigger1 = hitcount<30
attr = S,HP
hitflag = MAFD
;guardflag = MA
priority = 7,Hit
;damage = 7,0 ;ceil(13*root,fvar(12)), 3
damage = ceil(ifElse((root,fvar(11)) * 7 < 7, 7, (root,fvar(11)) * 7)), 0
getpower = 0,0
givepower = 20,20
pausetime = 2,6
animtype = Back
air.animtype = Back
fall.animtype = Back
ground.type = High
air.type = Low
ground.hittime = 16
ground.slidetime = 16
guard.hittime = 16
air.hittime = 13
airguard.ctrltime = 16
ground.velocity= -2,0
guard.velocity = -9
air.velocity = -5.5,-3.9
airguard.velocity = -5.5, -1.5
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
yaccel = .5
fall=1
air.fall = 1
fall.recover = 0
fall.recovertime = 13
sparkno = -1
;hitsound   = s1000,0
guardsound = S6,1
envshake.time = 16
envshake.ampl = 6
envshake.freq = 100
forcestand = 1
;palfx.sinadd=64,64,64,4
;palfx.mul=128,128,128
;palfx.time=32
p1sprpriority = 5
p2sprpriority = 3
kill = 0
getpower = 0,0
ID = 4005

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[State 250, 1]
type = PlaySnd
trigger1 = movehit
value = 1410,2 ;1000,0
volume = -200
;persistent = 1

[State 3822, Flash FX]
type = AllPalFX
trigger1 = 1 ;Time>=5
time = 1
add = 9*(UniqHitCount),9*(UniqHitCount),9*(UniqHitCount)
;mul = 256,256,256
;sinadd = 0,0,0,10
;invertall = 0
;color = 256
ignorehitpause = 1
;persistent =

[State 1061, NoJuggle]
type = parentvarset
trigger1 = movecontact
var(18) = 0

[State 1315, Sparks]
type=explod
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
anim=7030
sprpriority=6
postype=p2
pos=(target,const(size.ground.front)-10)+(random%20), -floor(p2dist y)+(random%20)-10
removetime=-2
ownpal=1
facing=-1
ignorehitpause=1
pausemovetime=100
supermovetime=100

[State 3005, end]
type = changestate
trigger1 = movecontact
value = ifelse(hitcount<30,4004,40041)

[State 1061, End]
type = destroyself
trigger1 = root,stateno != 4001

;-----------------------------------------
; FF vanish
[Statedef 40041]
type=A
physics=N
movetype=A
velset=0,0
anim = 40041 ;2504
ctrl=0
sprpriority=4

[State 40041, Remove Wave]
type = RemoveExplod
trigger1 = !time
id = 2505
;ignorehitpause =
;persistent =

[State 40041, White FX]
type = AllPalFX
trigger1 = !WinKO ;1
time = 1
add = 255, 255, 255
ignorehitpause = 1

[State 40041, nothitby]
type = nothitby
trigger1 = 1
time = 1
value = SCA
ignorehitpause = 1

[State 3005, hit]
type = hitdef
trigger1 = 1
attr = S,HP
hitflag = MAFD
;guardflag = MA
priority = 7,Hit
;damage = 7,0 ;ceil(13*root,fvar(12)), 3
damage = ceil(ifElse((root,fvar(11)) * 7 < 7, 7, (root,fvar(11)) * 7)), 0
getpower = 0,0
givepower = 20,20
pausetime = 2,6
animtype = Back
air.animtype = Back
fall.animtype = Back
ground.type = High
air.type = Low
ground.hittime = 16
ground.slidetime = 16
guard.hittime = 16
air.hittime = 13
airguard.ctrltime = 16
ground.velocity= -2,0
guard.velocity = -9
air.velocity = -5.5,-3.9
airguard.velocity = -5.5, -1.5
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
yaccel = .5
fall=1
air.fall = 1
fall.recover = 0
fall.recovertime = 13
sparkno = -1
;hitsound   = s1000,0
guardsound = S6,1
envshake.time = 16
envshake.ampl = 6
envshake.freq = 100
forcestand = 1
;palfx.sinadd=64,64,64,4
;palfx.mul=128,128,128
;palfx.time=32
p1sprpriority = 5
p2sprpriority = 3
kill = 1
getpower = 0,0
ID = 4005

[State 0, VarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
fvar(13) = 1

[State 0, Kill P2 redirection]
type= targetstate
trigger1= numtarget ;!time && numtarget
trigger1= target,alive=0
value= 4005

[State 40041, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 40041, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 40041, End]
type=destroyself
trigger1 = !animtime

;----------------------------------------------------
;[MAJIN]
;GJ TEMP BLAST
[Statedef 4105]
type    = S
movetype= A
physics = N
;anim = 1010
sprpriority = 5
hitcountpersist = 1
movehitpersist = 1

[State 3302, anim]
type = changeanim
trigger1 = !time
value = 3302



[State 3302, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
;flag2 = invisible
ignorehitpause = 1

[State 4106, transparency]
type = Trans
trigger1 = root,var(2)=1
trans = addalpha
alpha = 200,128
ignorehitpause = 1

[State 4106, Turn]
type = AngleDraw
trigger1 = 1
value = 90

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

[State 3302, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 3302, HitOverride]
type = HitOverride
;trigger1 = 1
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 41061
attr = SCA, NP, SP, HP
ignorehitpause = 1


[State 4106, Velocity]
type = VelSet
trigger1 = !time
x = 0
y = -18

[State 4106, Velocity]
type = VelSet
trigger1 = Movehit
y = 0


[State 4106, Hitdef]
type = HitDef
trigger1 = 1
attr = A, HP
animtype  = hard
damage    = 0,0 ;ceil(16*root,fvar(12)), ceil(2*root,fvar(12))
priority  = 4,Hit
guardflag = MA
hitflag = MAFD
pausetime = 0,10
guard.pausetime = 2,1
sparkno = S3435 ;s7010
guard.sparkno = -1
sparkxy = 0,0
hitsound   = s1000,0
guardsound = S6,1
ground.type = high
air.type = low
ground.slidetime = 15
ground.hittime  = 15
guard.slidetime = 7
guard.hittime  = 7
ground.velocity = -2,0
guard.velocity = -2
air.velocity = -2,5
airguard.velocity = -2, 2
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
air.fall = 0
fall.recover = 1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = 0,0  ;ifelse(p2movetype=H,40,140), 10
givepower = 35,35
p2stateno = 4112 ;4113
kill = 0

[State 3302, Sparks]
type=explod
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
anim=7020
sprpriority=7
postype=p2
pos=(target,const(size.ground.front)-2),-62 ;-77;floor(p2dist y)
removetime=-2
ownpal=1
facing=-1
ignorehitpause=1
persistent=0
pausemovetime=100
supermovetime=100


[State 4106, Explosion FX]
type = null ;Explod
triggerall = !NumExplod(4108)
trigger1 = movecontact
anim = 4108
id = 4108
pos = IfElse(facing=1,-155,155),125
postype = p2
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -2
sprpriority = 10
ontop = 1
ownpal = 1
bindtime = 0
scale = 1.5,1.5
persistent = 0

[State 4106, Sound]
type = PlaySnd
trigger1 = movecontact
value = 3330, 1

[State 4106, Guardshake]
type = envshake
trigger1 = moveguarded
time = 4
ampl = 6
freq = 176
ignorehitpause = 1

[State 3302, Helper Limiter]
type = null ;Helper
triggerall = !NumHelper(9999)
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
helpertype = normal
name = "Limiter"
ID = 9999
stateno = 9999
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1

[state 3302, Flame overlay]
type = null;helper
triggerall = !NumHelper(9990)
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
trigger1 = target,IsHelper=0
pos = 0,0
postype = left
ID = 9990
stateno = 9990
helpertype = normal
name = "Fire"
sprpriority = -5
ownpal = 1
ignorehitpause = 1

[State 3302, end]   ;Contact
type = changestate
trigger1 = movecontact
value = 41051


[State 4106, End]
type = destroyself
trigger1 = (pos y!=[-260,600])
trigger2 = time>100

;-----------------------------------------
;[MAJIN]
; GJ Blast explod/vanish
[Statedef 41051]
type=A
movetype=A
physics=N
velset=0,-1
ctrl=0
sprpriority=1

[State 33021, anim]
type = changeanim
trigger1 = !time
value = 3303


[State 33021, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
flag2 = nojugglecheck
;flag3 = invisible
ignorehitpause = 1

[State 33021, Projectile 1]
type = Projectile
trigger1 = AnimElemTime(3)=0
ProjID =  41051
projanim = 3307
projhitanim = 3307
projscale = 1,1
projremovetime = 24 ;-1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
velmul = 1
projhits = 1
projpriority = 1
projsprpriority = 6
projedgebound = 40
projstagebound = 40
projheightbound = -240
offset = -30,30
postype = p1
projshadow = 0,0,0
supermovetime = 0
pausemovetime = 0
; HitDef
attr = SCA,NP,SP,HP        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = MAFD        ;HLAFD+-
guardflag = MA         ;HLA
getpower = 0,0
givepower = 0,0
affectteam = E          ;B,E,F
animtype = hard          ;light,medium,hard,back,up,diagup
priority = 4,Hit   ;Hit,Miss,Dodge
damage = 0,0 ;ceil(30*root,fvar(12)),ceil(3*root,fvar(12))
pausetime = 0,0
guard.pausetime = 0,0
sparkno = 0
guard.sparkno = 0
sparkxy = 0,0
hitsound = S3300,2
;guardsound = S2511,0
ground.type = Low      ;Low,Trip,None
ground.velocity = -1,-2
air.velocity = -1,-2
fall = 0
fall.recover = 0
persistent = 0
p2stateno = 4112
kill = 0

[State 33021, Projectile 2]
type = Projectile
trigger1 = AnimElemTime(6)=0
ProjID =  41051
projanim = 3307
projhitanim = 3307
projscale = -1,-1
projremovetime = 24 ;-1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
velmul = 1
projhits = 1
projpriority = 1
projsprpriority = 6
projedgebound = 40
projstagebound = 40
projheightbound = -240
offset = 30,-30
postype = p1
projshadow = 0,0,0
supermovetime = 0
pausemovetime = 0
; HitDef
attr = SCA,NP,SP,HP        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = MAFD        ;HLAFD+-
guardflag = MA         ;HLA
getpower = 0,0
givepower = 0,0
affectteam = E          ;B,E,F
animtype = back ;hard          ;light,medium,hard,back,up,diagup
priority = 4,Hit   ;Hit,Miss,Dodge
damage = 0,0 ;ceil(30*root,fvar(12)),ceil(3*root,fvar(12))
pausetime = 0,0
guard.pausetime = 0,0
sparkno = 0
guard.sparkno = 0
sparkxy = 0,0
hitsound = S3300,2
;guardsound = S2511,0
ground.type = Low      ;Low,Trip,None
ground.velocity = 1,-2
air.velocity = 1,-2
fall = 0
fall.recover = 0
persistent = 0
p2stateno = 4112
kill = 0

[State 33021, Projectile 3]
type = Projectile
trigger1 = AnimElemTime(9)=0
ProjID =  41051
projanim = 3307
projhitanim = 3307
projscale = 1,-1
projremovetime = 24 ;-1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
velmul = 1
projhits = 1
projpriority = 1
projsprpriority = 6
projedgebound = 40
projstagebound = 40
projheightbound = -240
offset = -30,-30
postype = p1
projshadow = 0,0,0
supermovetime = 0
pausemovetime = 0
; HitDef
attr = SCA,NP,SP,HP        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = MAFD        ;HLAFD+-
guardflag = MA         ;HLA
getpower = 0,0
givepower = 0,0
affectteam = E          ;B,E,F
animtype = hard          ;light,medium,hard,back,up,diagup
priority = 4,Hit   ;Hit,Miss,Dodge
damage = 0,0 ;ceil(30*root,fvar(12)),ceil(3*root,fvar(12))
pausetime = 0,0
guard.pausetime = 0,0
sparkno = 0
guard.sparkno = 0
sparkxy = 0,0
hitsound = S3300,2
;guardsound = S2511,0
ground.type = Low      ;Low,Trip,None
ground.velocity = -1,-2
air.velocity = -1,-2
fall = 0
fall.recover = 0
persistent = 0
p2stateno = 4112
kill = 0

[State 33021, Projectile 4]
type = Projectile
trigger1 = AnimElemTime(12)=0
ProjID =  41051
projanim = 3307
projhitanim = 3307
projscale = -1,1
projremovetime = 24 ;-1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
velmul = 1
projhits = 1
projpriority = 1
projsprpriority = 6
projedgebound = 40
projstagebound = 40
projheightbound = -240
offset = 30,30
postype = p1
projshadow = 0,0,0
supermovetime = 0
pausemovetime = 0
; HitDef
attr = SCA,NP,SP,HP        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = MAFD        ;HLAFD+-
guardflag = MA         ;HLA
getpower = 0,0
givepower = 0,0
affectteam = E          ;B,E,F
animtype = hard          ;light,medium,hard,back,up,diagup
priority = 4,Hit   ;Hit,Miss,Dodge
damage = 0,0 ;ceil(30*root,fvar(12)),ceil(3*root,fvar(12))
pausetime = 0,0
guard.pausetime = 0,0
sparkno = 0
guard.sparkno = 0
sparkxy = 0,0
hitsound = S3300,2
;guardsound = S2511,0
ground.type = Low      ;Low,Trip,None
ground.velocity = -5,-2
air.velocity = -5,-2
fall = 1
fall.recover = 0
persistent = 0
p2stateno = 4112
kill = 0


[State 33021, Sound]
type = PlaySnd
trigger1 = !time
value = 3300, 1

[State 33021, nothitby]
type = nothitby
trigger1 = 1
time = 1
value = SCA
ignorehitpause = 1

[State 33021, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 33021, End with Zzyzzyxx fix]
type= destroyself
;triggerall = !animtime
trigger1 = time >= 54
trigger2 = !animtime
;trigger2 = !numtarget
;trigger3 = numtarget
;trigger3 = target, time <= 1 && !(target, hitshakeover)

;----------------------------------------------------
;[MAJIN]
;GJ TEMP BLAST LAST
[Statedef 4106]
type    = S
movetype= A
physics = N
;anim = 1010
sprpriority = 5
hitcountpersist = 1
movehitpersist = 1

[State 3302, anim]
type = changeanim
trigger1 = !time
value = 3302



[State 3302, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
;flag2 = invisible
ignorehitpause = 1

[State 4106, transparency]
type = Trans
trigger1 = root,var(2)=1
trans = addalpha
alpha = 200,128
ignorehitpause = 1

[State 4106, Turn]
type = AngleDraw
trigger1 = 1
value = 90

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

[State 3302, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 3302, HitOverride]
type = HitOverride
;trigger1 = 1
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 41061
attr = SCA, NP, SP, HP
ignorehitpause = 1


[State 4106, Velocity]
type = VelSet
trigger1 = !time
x = 0
y = -18

[State 4106, Velocity]
type = VelSet
trigger1 = Movehit
y = 0


[State 4106, Hitdef]
type = HitDef
trigger1 = 1
attr = A, HP
animtype  = hard
damage    = 0,0 ;ceil(16*root,fvar(12)), ceil(2*root,fvar(12))
priority  = 4,Hit
guardflag = MA
hitflag = MAFD
pausetime = 0,10
guard.pausetime = 2,1
sparkno = S3435 ;s7010
guard.sparkno = -1
sparkxy = 0,0
hitsound   = s1000,0
guardsound = S6,1
ground.type = high
air.type = low
ground.slidetime = 15
ground.hittime  = 15
guard.slidetime = 7
guard.hittime  = 7
ground.velocity = -2,0
guard.velocity = -2
air.velocity = -2,5
airguard.velocity = -2, 2
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
air.fall = 0
fall.recover = 1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = 0,0  ;ifelse(p2movetype=H,40,140), 10
givepower = 35,35
p2stateno = 4112 ;4113
kill = 0

[State 3302, Sparks]
type=explod
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
anim=7020
sprpriority=7
postype=p2
pos=(target,const(size.ground.front)-2),-62 ;-77;floor(p2dist y)
removetime=-2
ownpal=1
facing=-1
ignorehitpause=1
persistent=0
pausemovetime=100
supermovetime=100


[State 4106, Explosion FX]
type = null ;Explod
triggerall = !NumExplod(4108)
trigger1 = movecontact
anim = 4108
id = 4108
pos = IfElse(facing=1,-155,155),125
postype = p2
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -2
sprpriority = 10
ontop = 1
ownpal = 1
bindtime = 0
scale = 1.5,1.5
persistent = 0

[State 4106, Sound]
type = PlaySnd
trigger1 = movecontact
value = 3330, 1

[State 4106, Guardshake]
type = envshake
trigger1 = moveguarded
time = 4
ampl = 6
freq = 176
ignorehitpause = 1

[State 3302, Helper Limiter]
type = null ;Helper
triggerall = !NumHelper(9999)
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
helpertype = normal
name = "Limiter"
ID = 9999
stateno = 9999
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1

[state 3302, Flame overlay]
type = helper
triggerall = !NumHelper(9990)
trigger1= movehit && numtarget
trigger1= (target,movetype=H) && !(target,time)
trigger1 = target,IsHelper=0
pos = 0,0
postype = left
ID = 9990
stateno = 9990
helpertype = normal
name = "Fire"
sprpriority = -5
ownpal = 1
ignorehitpause = 1

[State 3302, end]   ;Contact
type = changestate
trigger1 = movecontact
value = 41061


[State 4106, End]
type = destroyself
trigger1 = (pos y!=[-260,600])
trigger2 = time>100

;-----------------------------------------
;[MAJIN]
; GJ Last Blast explod/vanish
[Statedef 41061]
type=A
movetype=A
physics=N
velset=0,-1
ctrl=0
sprpriority=1

[State 33021, anim]
type = changeanim
trigger1 = !time
value = 3303


[State 33021, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
flag2 = nojugglecheck
;flag3 = invisible
ignorehitpause = 1

[State 33021, Projectile 1]
type = Projectile
trigger1 = AnimElemTime(3)=0
ProjID =  41061
projanim = 3307
projhitanim = 3307
projscale = 1,1
projremovetime = 24 ;-1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
velmul = 1
projhits = 1
projpriority = 1
projsprpriority = 6
projedgebound = 40
projstagebound = 40
projheightbound = -240
offset = -30,30
postype = p1
projshadow = 0,0,0
supermovetime = 0
pausemovetime = 0
; HitDef
attr = SCA,NP,SP,HP        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = MAFD        ;HLAFD+-
guardflag = MA         ;HLA
getpower = 0,0
givepower = 0,0
affectteam = E          ;B,E,F
animtype = hard          ;light,medium,hard,back,up,diagup
priority = 4,Hit   ;Hit,Miss,Dodge
damage = 0,0 ;ceil(30*root,fvar(12)),ceil(3*root,fvar(12))
pausetime = 0,0
guard.pausetime = 0,0
sparkno = 0
guard.sparkno = 0
sparkxy = 0,0
hitsound = S3300,2
;guardsound = S2511,0
ground.type = Low      ;Low,Trip,None
ground.velocity = -1,-2
air.velocity = -1,-2
fall = 0
fall.recover = 0
persistent = 0
p2stateno = 4112
kill = 0

[State 33021, Projectile 2]
type = Projectile
trigger1 = AnimElemTime(6)=0
ProjID =  41061
projanim = 3307
projhitanim = 3307
projscale = -1,-1
projremovetime = 24 ;-1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
velmul = 1
projhits = 1
projpriority = 1
projsprpriority = 6
projedgebound = 40
projstagebound = 40
projheightbound = -240
offset = 30,-30
postype = p1
projshadow = 0,0,0
supermovetime = 0
pausemovetime = 0
; HitDef
attr = SCA,NP,SP,HP        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = MAFD        ;HLAFD+-
guardflag = MA         ;HLA
getpower = 0,0
givepower = 0,0
affectteam = E          ;B,E,F
animtype = back ;hard          ;light,medium,hard,back,up,diagup
priority = 4,Hit   ;Hit,Miss,Dodge
damage = 0,0 ;ceil(30*root,fvar(12)),ceil(3*root,fvar(12))
pausetime = 0,0
guard.pausetime = 0,0
sparkno = 0
guard.sparkno = 0
sparkxy = 0,0
hitsound = S3300,2
;guardsound = S2511,0
ground.type = Low      ;Low,Trip,None
ground.velocity = 1,-2
air.velocity = 1,-2
fall = 0
fall.recover = 0
persistent = 0
p2stateno = 4112
kill = 0

[State 33021, Projectile 3]
type = Projectile
trigger1 = AnimElemTime(9)=0
ProjID =  41061
projanim = 3307
projhitanim = 3307
projscale = 1,-1
projremovetime = 24 ;-1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
velmul = 1
projhits = 1
projpriority = 1
projsprpriority = 6
projedgebound = 40
projstagebound = 40
projheightbound = -240
offset = -30,-30
postype = p1
projshadow = 0,0,0
supermovetime = 0
pausemovetime = 0
; HitDef
attr = SCA,NP,SP,HP        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = MAFD        ;HLAFD+-
guardflag = MA         ;HLA
getpower = 0,0
givepower = 0,0
affectteam = E          ;B,E,F
animtype = hard          ;light,medium,hard,back,up,diagup
priority = 4,Hit   ;Hit,Miss,Dodge
damage = 0,0 ;ceil(30*root,fvar(12)),ceil(3*root,fvar(12))
pausetime = 0,0
guard.pausetime = 0,0
sparkno = 0
guard.sparkno = 0
sparkxy = 0,0
hitsound = S3300,2
;guardsound = S2511,0
ground.type = Low      ;Low,Trip,None
ground.velocity = -1,-2
air.velocity = -1,-2
fall = 0
fall.recover = 0
persistent = 0
p2stateno = 4113
kill = 0

[State 33021, Projectile 4]
type = Projectile
trigger1 = AnimElemTime(12)=0
ProjID =  41061
projanim = 3307
projhitanim = 3307
projscale = -1,1
projremovetime = 24 ;-1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
velmul = 1
projhits = 1
projpriority = 1
projsprpriority = 6
projedgebound = 40
projstagebound = 40
projheightbound = -240
offset = 30,30
postype = p1
projshadow = 0,0,0
supermovetime = 0
pausemovetime = 0
; HitDef
attr = SCA,NP,SP,HP        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = MAFD        ;HLAFD+-
guardflag = MA         ;HLA
getpower = 0,0
givepower = 0,0
affectteam = E          ;B,E,F
animtype = hard          ;light,medium,hard,back,up,diagup
priority = 4,Hit   ;Hit,Miss,Dodge
;damage = 170, 0 ;ceil(30*root,fvar(12)),ceil(3*root,fvar(12))
;damage = ceil(ifElse((root,fvar(11)) * 170 < 7, 7, (root,fvar(11)) * 170)), 0
damage = ceil(ifElse((root,fvar(11)) * 170 < 40, 40, (root,fvar(11)) * 170)), 0
pausetime = 0,0
guard.pausetime = 0,0
sparkno = 0
guard.sparkno = 0
sparkxy = 0,0
hitsound = S3300,2
;guardsound = S2511,0
ground.type = Low      ;Low,Trip,None
ground.velocity = -5,-2
air.velocity = -5,-2
fall = 1
fall.recover = 0
persistent = 0
p2stateno = 4113
kill = 0

[State 33021, Sound]
type = PlaySnd
trigger1 = !time
value = 3300, 1

[State 33021, nothitby]
type = nothitby
trigger1 = 1
time = 1
value = SCA
ignorehitpause = 1

[State 33021, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 33021, End with Zzyzzyxx fix]
type= destroyself
;triggerall = !animtime
trigger1 = time >= 54
trigger2 = !animtime
;trigger2 = !numtarget
;trigger3 = numtarget
;trigger3 = target, time <= 1 && !(target, hitshakeover)
;====================================
; SGJ - Vertical Lines BG
[Statedef 4107]
type = A
movetype = A
physics = N
anim = 2771
velset = 0,0

[State 4107, push]
type = PlayerPush
trigger1 = Time >= 0
value = 0

[State 4107, muteki]
type = NotHitBy
trigger1 = 1
value = SCA

[State 4107, bg]
type = assertspecial
trigger1 = 1
flag = noFG
flag2 = noBG
flag3 = nobardisplay
ignorehitpause = 1

[State 4107, flash]
type = null ;PalFX
trigger1 = TimeMod = 4,0
trigger1 = 1
time = 1
invertall = 1
ignorehitpause = 0

[state 4107, speedlines]
type = explod
trigger1 = time = 0
anim = 12773
ID = 2773
postype = back
pos = 10,0
bindtime = -1
supermove = 0
sprpriority = -1
ontop = 0
ownpal = 1
facing = 1
ignorehitpause = 1
;pausemovetime = 145
removetime = -1

[state 4107, speedlines2]
type = explod
trigger1 = time = 0
anim = 12773
ID = 2773
postype = back
pos = 240,0
bindtime = -1
supermove = 0
sprpriority = -1
ontop = 0
ownpal = 1
facing = 1
ignorehitpause = 1
;pausemovetime = 145
removetime = -1

[State 4107, destroy explod]
type = RemoveExplod
trigger1 = root,stateno != [4100,4102]
trigger1 = root,stateno != [41001,41002]
trigger2 = enemy,Alive=0              ;Remove if enemy is dead
;trigger2 = target,stateno = 4114
ID = 2773

[State 4107, destroy]
type = DestroySelf
trigger1 = root,stateno != [4100,4102]
trigger1 = root,stateno != [41001,41002]
trigger2 = enemy,Alive=0              ;Remove if enemy is dead
;trigger2 = target,stateno = 4114


;==========================================================
;[MAJIN]
; SANITY GAUGE HELPER P1
[Statedef 4750]
physics = N
velset = 0, 0
sprpriority = 7
anim = 15999

[State 4750, Assert]
type = assertspecial
trigger1 = 1
flag = invisible
ignorehitpause = 1

;SANITY
;4750 = lv 1 filling
;4751 = lv 1 full
;4752 = lv 2 filling
;4753 = lv 2 full
;4754 = lv 3 filling
;4755 = lv 3 full
;4756 = lv MAX flash
;4757 = lv 1 Kanji P1
;4758 = lv 2 Kanji
;4759 = lv 3 Kanji
;4760 = lv MAX Kanji


;-------------------------------------------------------------------------------
[State 4750, Bar filling 1]
type = Explod
triggerall = root,var(58)<700
trigger1 = !NumExplod(4750) && (root,var(53))>0
anim = 4750
pos = 30+(root,var(45)),230-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 5
id = 4750
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

[State 4750, Scale Bar filling 1]
type = ModifyExplod
trigger1 = NumExplod(4750) && (root,var(53))>0
trigger1 = root,var(58)<700
scale = 0.5*(root,var(58))/700.0
id = 4750

[state 4750,remove Bar filling 1]
type = removeexplod
trigger1 = (root,var(53))<=0
trigger2 = (root,var(58))<=0 || (root,var(58))>=700
id = 4750

[State 4750, Bar full 1]
type = Explod
trigger1 = !NumExplod(4751) && (root,var(53))>0
trigger1 = (root,var(58))>=700 && (root,var(58))<1400
anim = 4751
pos = 31+(root,var(45)),230-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 5
id = 4751
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

[state 4750,remove Bar full 1]
type = removeexplod
trigger1 = (root,var(53))<=0
trigger2 = (root,var(58))<700 || (root,var(58))>=1400
id = 4751


[State 4750, Bar filling 2]
type = Explod
triggerall = (root,var(58))>=700 || (root,var(58))<1400
trigger1 = !NumExplod(4752) && (root,var(53))>0
anim = 4752
pos = 30+(root,var(45)),230-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 5
id = 4752
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

[State 4750, Scale Bar filling 2]
type = ModifyExplod
trigger1 = NumExplod(4752) && (root,var(53))>0
trigger1 = root,var(58)>=700 && root,var(58)<1400
scale = abs(0.5*(root,var(58)-700)/700.0),0.5
id = 4752

[state 4750,remove Bar filling 2]
type = removeexplod
trigger1 = (root,var(53))<=0
trigger2 = (root,var(58))<700 || (root,var(58))>=1400
id = 4752

[State 4750, Bar full 2]
type = Explod
trigger1 = !NumExplod(4753) && (root,var(53))>0
trigger1 = (root,var(58))>=1400 && (root,var(58))<2100
anim = 4753
pos = 31+(root,var(45)),230-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 5
id = 4753
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

[state 4750,remove Bar full 2]
type = removeexplod
trigger1 = (root,var(53))<=0
trigger2 = (root,var(58))<1400 || (root,var(58))>=2100
id = 4753

[State 4750, Bar filling 3]
type = Explod
triggerall = root,var(58)>=1400 && root,var(58)<2100
trigger1 = !NumExplod(4754) && (root,var(53))>0
anim = 4754
pos = 30+(root,var(45)),230-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 5
id = 4754
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

[State 4750, Scale Bar filling 3]
type = ModifyExplod
trigger1 = NumExplod(4754) && (root,var(53))>0
trigger1 = root,var(58)>=1400 && root,var(58)<2100
scale = abs(0.5*(root,var(58)-1400)/700.0),0.5
id = 4754

[state 4750,remove Bar filling 3]
type = removeexplod
trigger1 = (root,var(53))<=0
trigger2 = (root,var(58))<1400 || (root,var(58))>=2100
id = 4754

[State 4750, Bar full 3]
type = Explod
trigger1 = !NumExplod(4755) && (root,var(53))>0
trigger1 = (root,var(58))=2100
anim = 4755
pos = 31+(root,var(45)),230-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 5
id = 4755
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

[state 4750,remove Bar full 3]
type = removeexplod
trigger1 = (root,var(53))<=0
trigger2 = (root,var(58))>=2100
id = 4755

[State 4750, Bar MAX flash]
type = Explod
triggerall = (root,var(58))>=2100
trigger1 = !NumExplod(4756) && (root,var(53))>0
anim = 4756
pos = 31+(root,var(45)),230-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 5
id = 4756
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999


[state 4750,remove Bar MAX flash]
type = removeexplod
trigger1 = (root,var(53))<=0 || (root,var(58))<2100
id = 4756

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

[State 4750, Kanji 1 & Bar]
type = Explod
trigger1 = !NumExplod(4757) && (root,var(53))>0
anim = 4757
pos = 31+(root,var(45)),230-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 10
id = 4757
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

[state 4750,remove Kanji 1]
type = removeexplod
trigger1 = (root,var(53))<=0  ; || (root,var(58))>=700
id = 4757

[State 0, Helper LV 1 Sound]
type = Helper
triggerall = !NumExplod(4762)
trigger1 = (root,var(58))>=700 && !NumHelper(47501)
helpertype = normal ;player
name =  "Lv 1"
ID = 47501
stateno = 47501
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
pausemovetime = 999999
supermovetime = 999999
ignorehitpause = 1


[State 4750, Kanji 2]
type = Explod
trigger1 = !NumExplod(4758) && (root,var(53))>0
trigger1 = (root,var(58))>=700 && (root,var(58))<1400
anim = 4758
pos = 31+(root,var(45)),230-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 5
id = 4758
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

[state 4750,remove Kanji 2]
type = removeexplod
trigger1 = (root,var(53))<=0
trigger2 = (root,var(58))<700 || (root,var(58))>=1400
id = 4758

[State 0, Helper LV 2 Sound]
type = Helper
triggerall = !NumExplod(4762)
trigger1 = (root,var(58))>=1400 && !NumHelper(47502)
helpertype = normal ;player
name =  "Lv 1"
ID = 47502
stateno = 47502
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
pausemovetime = 999999
supermovetime = 999999
ignorehitpause = 1

[State 4750, Kanji 3]
type = Explod
trigger1 = !NumExplod(4759) && (root,var(53))>0
trigger1 = (root,var(58))>=1400 && (root,var(58))<2100
anim = 4759
pos = 31+(root,var(45)),230-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 5
id = 4759
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

[state 4750,remove Kanji 3]
type = removeexplod
trigger1 = (root,var(53))<=0
trigger2 = (root,var(58))<1400 || (root,var(58))>=2100
id = 4759

[State 4750, Kanji MAX]
type = Explod
trigger1 = !NumExplod(4760) && (root,var(53))>0
trigger1 = (root,var(58))>=2100
anim = 4760
pos = 31+(root,var(45)),230-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 5
id = 4760
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

[state 4750,remove Kanji MAX]
type = removeexplod
trigger1 = (root,var(53))<=0
trigger2 = (root,var(58))<2100
id = 4760

;-------------------------------------------------------------------------------
[State 4750, Explod];Sanity Gauge fades
type = Explod
trigger1 = !NumExplod(4762) && (root,var(53))<=0
anim = 4762
pos = 31+(root,var(45)),230-(root,var(46))
postype = left
removetime = 14
supermove = 1
scale = 0.5,0.5
sprpriority = 7
id = 4762
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999
persistent = 0

[State 4750, Kanji Fade];Sanity Kanji fades
type = Explod
triggerall = root,var(58)>=700
trigger1 = !NumExplod(4764) && (root,var(53))<=0
anim = 4764+(root,var(58)>=1400)+(root,var(58)>=2100)
pos = 31+(root,var(45)),230-(root,var(46))
postype = left
removetime = 14
supermove = 1
scale = 0.5,0.5
sprpriority = 7
id = 4764
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999
persistent = 0

[State 4750, End]
type = destroyself
trigger1 = (root,var(53))<=0 && !numexplod(4762)

;==========================================================
;[MAJIN]
; SANITY GAUGE HELPER P2
[Statedef 4760]
physics = N
velset = 0, 0
sprpriority = 7
anim = 15999

[State 4760, Assert]
type = assertspecial
trigger1 = 1
flag = invisible
ignorehitpause = 1

;SANITY
;4750 = lv 1 filling
;4751 = lv 1 full
;4752 = lv 2 filling
;4753 = lv 2 full
;4754 = lv 3 filling
;4755 = lv 3 full
;4756 = lv MAX flash
;4761 = lv 1 Kanji P2
;4758 = lv 2 Kanji
;4759 = lv 3 Kanji
;4760 = lv MAX Kanji

;-------------------------------------------------------------------------------
[State 4760, Bar filling 1]
type = Explod
triggerall = root,var(58)<700
trigger1 = !NumExplod(4750) && (root,var(53))>0
anim = 4750
pos = 289+(root,var(45)),230-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = -0.5,0.5
sprpriority = 5
id = 4750
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

[State 4760, Scale Bar filling 1]
type = ModifyExplod
trigger1 = NumExplod(4750) && (root,var(53))>0
trigger1 = root,var(58)<700
scale = -0.5*(root,var(58))/700.0
id = 4750

[state 4760,remove Bar filling 1]
type = removeexplod
trigger1 = (root,var(53))<=0
trigger2 = (root,var(58))<=0 || (root,var(58))>=700
id = 4750

[State 4760, Bar full 1]
type = Explod
trigger1 = !NumExplod(4751) && (root,var(53))>0
trigger1 = (root,var(58))>=700 && (root,var(58))<1400
anim = 4751
pos = 245+(root,var(45)),230-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 5
id = 4751
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

[state 4760,remove Bar full 1]
type = removeexplod
trigger1 = (root,var(53))<=0
trigger2 = (root,var(58))<700 || (root,var(58))>=1400
id = 4751

[State 4760, Bar filling 2]
type = Explod
triggerall = (root,var(58))>=700 || (root,var(58))<1400
trigger1 = !NumExplod(4752) && (root,var(53))>0
anim = 4752
pos = 289+(root,var(45)),230-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = -0.5,0.5
sprpriority = 5
id = 4752
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

[State 4760, Scale Bar filling 2]
type = ModifyExplod
trigger1 = NumExplod(4752) && (root,var(53))>0
trigger1 = root,var(58)>=700 && root,var(58)<1400
scale = -1*abs(0.5*(root,var(58)-700)/700.0),0.5
id = 4752

[state 4760,remove Bar filling 2]
type = removeexplod
trigger1 = (root,var(53))<=0
trigger2 = (root,var(58))<700 || (root,var(58))>=1400
id = 4752

[State 4760, Bar full 2]
type = Explod
trigger1 = !NumExplod(4753) && (root,var(53))>0
trigger1 = (root,var(58))>=1400 && (root,var(58))<2100
anim = 4753
pos = 245+(root,var(45)),230-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 5
id = 4753
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

[state 4760,remove Bar full 2]
type = removeexplod
trigger1 = (root,var(53))<=0
trigger2 = (root,var(58))<1400 || (root,var(58))>=2100
id = 4753

[State 4760, Bar filling 3]
type = Explod
triggerall = root,var(58)>=1400 && root,var(58)<2100
trigger1 = !NumExplod(4754) && (root,var(53))>0
anim = 4754
pos = 289+(root,var(45)),230-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = -0.5,0.5
sprpriority = 5
id = 4754
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

[State 4760, Scale Bar filling 3]
type = ModifyExplod
trigger1 = NumExplod(4754) && (root,var(53))>0
trigger1 = root,var(58)>=1400 && root,var(58)<2100
scale = -1*abs(0.5*(root,var(58)-1400)/700.0),0.5
id = 4754

[state 4760,remove Bar filling 3]
type = removeexplod
trigger1 = (root,var(53))<=0
trigger2 = (root,var(58))<1400 || (root,var(58))>=2100
id = 4754

[State 4760, Bar full 3]
type = removeexplod
triggerall = !NumExplod(4755) && (root,var(53))>0
trigger1 = root,var(58)=2100
anim = 4755
pos = 245+(root,var(45)),230-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 5
id = 4755
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

[state 4760,remove Bar full 3]
type = removeexplod
trigger1 = (root,var(53))<=0
trigger2 = (root,var(58))>=2100
id = 4755

[State 4760, Bar MAX flash]
type = Explod
triggerall = (root,var(58))>=2100
trigger1 = !NumExplod(4756) && (root,var(53))>0
anim = 4756
pos = 245+(root,var(45)),230-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 5
id = 4756
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999


[state 4760,remove Bar MAX flash]
type = removeexplod
trigger1 = (root,var(53))<=0 || (root,var(58))<2100
id = 4756

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

[State 4760, Kanji 1 & Bar]
type = Explod
trigger1 = !NumExplod(4761) && (root,var(53))>0
anim = 4761
pos = 245+(root,var(45)),230-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 10
id = 4761
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

[state 4760,remove Kanji 1]
type = removeexplod
trigger1 = (root,var(53))<=0  ; || (root,var(58))>=700
id = 4761

[State 4760, Helper LV 1 Sound]
type = Helper
triggerall = !NumExplod(4763)
trigger1 = (root,var(58))>=700 && !NumHelper(47501)
helpertype = normal ;player
name =  "Lv 1"
ID = 47501
stateno = 47501
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
pausemovetime = 999999
supermovetime = 999999
ignorehitpause = 1

[State 4760, Kanji 2]
type = Explod
trigger1 = !NumExplod(4758) && (root,var(53))>0
trigger1 = (root,var(58))>=700 && (root,var(58))<1400
anim = 4758
pos = 179+(root,var(45)),230-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 5
id = 4758
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

[state 4760,remove Kanji 2]
type = removeexplod
trigger1 = (root,var(53))<=0
trigger2 = (root,var(58))<700 || (root,var(58))>=1400
id = 4758

[State 4760, Helper LV 2 Sound]
type = Helper
triggerall = !NumExplod(4763)
trigger1 = (root,var(58))>=1400 && !NumHelper(47502)
helpertype = normal ;player
name =  "Lv 1"
ID = 47502
stateno = 47502
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
pausemovetime = 999999
supermovetime = 999999
ignorehitpause = 1

[State 4760, Kanji 3]
type = Explod
trigger1 = !NumExplod(4759) && (root,var(53))>0
trigger1 = (root,var(58))>=1400 && (root,var(58))<2100
anim = 4759
pos = 179+(root,var(45)),230-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 5
id = 4759
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

[state 4760,remove Kanji 3]
type = removeexplod
trigger1 = (root,var(53))<=0
trigger2 = (root,var(58))<1400 || (root,var(58))>=2100
id = 4759

[State 4760, Kanji MAX]
type = Explod
trigger1 = !NumExplod(4760) && (root,var(53))>0
trigger1 = (root,var(58))>=2100
anim = 4760
;pos = 245+(root,var(45)),230-(root,var(46))
pos = 179+(root,var(45)),230-(root,var(46))
postype = left
removetime = -1
supermove = 1
scale = 0.5,0.5
sprpriority = 5
id = 4760
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999

[state 4760,remove Kanji MAX]
type = removeexplod
trigger1 = (root,var(53))<=0
trigger2 = (root,var(58))<2100
id = 4760
;-------------------------------------------------------------------------------

[State 4760, Explod];Sanity Gauge fades
type = Explod
trigger1 = !NumExplod(4763) && (root,var(53))<=0
anim = 4763
pos = 245+(root,var(45)),230-(root,var(46))
postype = left
removetime = 14
supermove = 1
scale = 0.5,0.5
sprpriority = 7
id = 4763
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999
persistent = 0

[State 4760, Kanji Fade];Sanity Kanji fades
type = Explod
triggerall = root,var(58)>=700
trigger1 = !NumExplod(4767) && (root,var(53))<=0
anim = 4767+(root,var(58)>=1400)+(root,var(58)>=2100)
pos = 179+(root,var(45)),230-(root,var(46))
postype = left
removetime = 14
supermove = 1
scale = 0.5,0.5
sprpriority = 7
id = 4767
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 999999
supermovetime = 999999
persistent = 0

[State 4760, End]
type = destroyself
trigger1 = (root,var(53))<=0 && !numexplod(4763)


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

;==========================================================
;[MAJIN]
; SG LV1 Sound
[Statedef 47501]
physics = N
velset = 0, 0
sprpriority = 7
anim = 15999

[State 47501, Assert]
type = assertspecial
trigger1 = 1
flag = invisible
ignorehitpause = 1

[State 47501, PlaySnd - Sanity level]
type = PlaySnd
triggerall = root,var(53)>0
trigger1 = !time
value = 4700,0
volume =300
channel = -1
ignorehitpause = 1
persistent = 0

[State 47501, End]
type = destroyself
trigger1 = (root,var(53))<=0
trigger2 = (root,var(58))<700

;[MAJIN]
; SG LV2 Sound
[Statedef 47502]
physics = N
velset = 0, 0
sprpriority = 7
anim = 15999

[State 47502, Assert]
type = assertspecial
trigger1 = 1
flag = invisible
ignorehitpause = 1

[State 47502, PlaySnd - Sanity level]
type = PlaySnd
triggerall = root,var(53)>0
trigger1 = !time
value = 4700,0
volume =300
channel = -1
ignorehitpause = 1
persistent = 0

[State 47502, End]
type = destroyself
trigger1 = (root,var(53))<=0
trigger2 = (root,var(58))<1400

;-------------------------------
;[MAJIN]
; The M
[Statedef 7747]
type    = S
movetype= I
physics = N
anim = 747
sprpriority = 10
hitcountpersist = 1
movehitpersist = 1


[State 747, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow


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

[State 747, Bleeding FX]
type = PalFX
trigger1 = !time
time = 180
add = 0,-200,-200
mul = 256,256,256
sinadd = 40,80,40,30
invertall = 1
color = 0

[State 747, Power Charge BindToRoot]
type = BindToRoot
trigger1 = root,anim=903
time = 1
pos = 5,8

[State 747, Power Charge Offset 1]
type = Offset
triggerall = root,anim=903
trigger1 = time%6=[3,5]
y = 0

[State 747, Power Charge Offset 2]
type = Offset
triggerall = root,anim=903
trigger1 = time%6=[0,2]
y = -1

[State 747, Sanity Charge BindToRoot]
type = BindToRoot
trigger1 = root,anim=912
time = 1
pos = -12,6

[State 747, Sanity Charge Offset 1]
type = Offset
triggerall = root,anim=912
trigger1 = time%20=[5,9]
trigger2 = time%20=[15,19]
x = IfElse((root,facing=1),-1,1)
y = 0

[State 747, Sanity Charge Offset  2]
type = Offset
triggerall = root,anim=912
trigger1 = time%20=[0,4]
trigger2 = time%20=[10,14]
x = IfElse((root,facing=1),2,-2)
y = 2

[State 747, Multiple Bone Offset 1]
type = Offset
triggerall = root,anim=18746
trigger1 = time%10=[5,9]
x = IfElse((root,facing=1),1,-1)
y = 0

[State 747, Multiple Bone Offset 2]
type = Offset
triggerall = root,anim=18746
trigger1 = time%10=[0,4]
y = -1

[State 747, Malevolent Rotation]
type = AngleDraw
trigger1 = root,anim=18747
value = 45
;scale =

[State 747, Fade In]
type = Trans
trigger1 = time = [0,32]
trans = addalpha
alpha = 0+8*time,256-8*time;256,256-8*time

[State 747, Fade Away]
type = Trans
trigger1 = time = [148,180]
trans = addalpha
alpha = 256-8*(time-148),0+8*(time-148)


[State 747, End]
type = destroyself
trigger1 = root,anim=9033  ;stop charging power
trigger2 = root,prevstateno=910 && root,stateno=4700  ;charging power -> Sanity mode
trigger3 = root,anim=9121  ;stop Sanity charging power
trigger4 = root,movetype=H ;remove on get hit
trigger5 = root,anim=18745  ;METAL!
trigger5 = root,animelemtime(7)=0
trigger6 = root,anim=18746  ;MULTIPLE BONE
trigger6 = root,animelemtime(37)=0
trigger7 = root,anim=18747  ;MALEVOLENT
trigger7 = root,animelemtime(35)=0
trigger8 = time>=180

;----------------------------------------------------
;[MAJIN]
;Babidi Charge Helper
[Statedef 9100]
type = A
movetype = I
physics = N
ctrl = 0
anim = IfElse((root,var(58)<700),9101,IfElse(((root,var(58))>=700 && (root,var(58))<1400),9102,9103))
velset = 0,0
sprpriority = -1

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

[State 9100, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = NoShadow

[State 9100, Fade In]
type = Trans
trigger1 = time = [0,32]
trans = addalpha
alpha = 0+8*time,256-8*time

[State 9100, Offset]
type = Offset
trigger1 = 1
x = 0
y = 5*sin(time/5.0)

[State 9100, VelSet]
type = null ;VelSet
trigger1 = rootdist X != [75,125]
x = IfElse(rootdist X>125,1.5,-1.5)

[State 9100, VelSet]
type = null ;VelSet
trigger1 = rootdist X = [75,125]
x = 0

[State 9100, ChangeAnim 1-2]
type = ChangeAnim
trigger1 = Anim=9101
trigger1 = root,var(58)>=700
value = 9102
ignorehitpause = 1
;persistent =

[State 9100, ChangeAnim 2-1]
type = ChangeAnim
trigger1 = Anim=9102
trigger1 = root,var(58)<700
value = 9101
ignorehitpause = 1
;persistent =

[State 9100, Babidi voice] ; kekekeke/Make them bleed
type = PlaySnd
triggerall = random<333
trigger1 = Anim=9101
trigger1 = AnimElemTime(1)=0
value = 9100,0+random%2
channel = 8
persistent = 0

[State 9100, Babidi voice] ; Wh...What??
type = PlaySnd
triggerall = random<333
trigger1 = Anim=9102 || Anim=9103
trigger1 = AnimElemTime(1)=0
value = 9100,10+random%2
channel = 8
persistent = 0


[State 9100, ChangeAnim 2-3]
type = ChangeAnim
trigger1 = Anim=9102
trigger1 = root,var(58)>=1400
value = 9103
ignorehitpause = 1
;persistent =

[State 9100, ChangeAnim 3-2]
type = ChangeAnim
trigger1 = Anim=9103
trigger1 = root,var(58)<1400
value = 9102
ignorehitpause = 1
;persistent =

[State 9100, Go to Vanish]
type = ChangeState
trigger1 = Root,StateNo != 910
value = 9105
ctrl = 0


;----------------------------------------------------
;[MAJIN]
;Babidi Charge Helper Vanish
[Statedef 9105]
type = A
movetype = I
physics = N
ctrl = 0
;anim = IfElse((root,var(58)<700),9100,IfElse(((root,var(58))>=700 && (root,var(58))<1400),9101,9102))
velset = 0,0
sprpriority = -1

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

[State 9105, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = NoShadow

[State 9105, Offset]
type = Offset
trigger1 = 1
x = 0
y = 5*sin(time/5.0)

[State 9105, VelSet]
type = null ;VelSet
trigger1 = rootdist X != [75,125]
x = IfElse(rootdist X>125,1.5,-1.5)

[State 9105, VelSet]
type = null ;VelSet
trigger1 = rootdist X = [75,125]
x = 0

[State 9105, Fade Away]
type = Trans
trigger1 = time>0
trans = addalpha
alpha = 256-8*(time),0+8*(time)

[State 9105, Back to Sanity Charge]
type = ChangeState
trigger1 = Root,StateNo = 910
value = 9100
ctrl = 0

[State 9105, DestroySelf]
type = DestroySelf
trigger1 = time = 32

;[MAJIN]
;----------------------------------------------------
;Babidi Idle
[Statedef 9110]
type = A
movetype = I
physics = N
ctrl = 0
anim = 9100
velset = 0,0
sprpriority = 8 ;-10

[State 3010, Babidi power]
type = Explod
trigger1 = !Time
trigger1 = root,stateno!=789 ;Turning around
anim =  9115
ID =  9115
pos = 0,0
postype = p1 ;p2,front,back,left,right
supermovetime = 9999
pausemovetime = 9999
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = 9 ;-9
ownpal = 1
removeongethit = 0
ignorehitpause = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = root,stateno!=789 ;Turning around
trigger1 = !time
value = 2400,10
volume = 0
channel = -1

[State 3010, Babidi talk]
type = Explod
trigger1 = !Time
anim =  9110
ID =  9110
pos = 0,0
postype = p1 ;p2,front,back,left,right
supermovetime = 9999
pausemovetime = 9999
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = 10 ;-8
ownpal = 1
removeongethit = 0
ignorehitpause = 1

[State 13100, Babidi Voice] ;TEMP
type = null ;playsnd
trigger1 = !Time
value = 188,8
volume = 300
channel = -1
persistent = 0

[State 0, Remove Power]
type = RemoveExplod
trigger1 = Root,StateNo=0
trigger2 = root,stateno=3901 && time=110 ;Necromancer
id = 9115

[State 0, Remove Talk]
type = RemoveExplod
trigger1 = Root,StateNo=0
trigger2 = root,stateno=3901 && time=420 ;110 ;Necromancer
trigger3 = root,stateno=789 && time=380 ;420  ;Turning around
trigger4 = root,stateno=735 && time=210 ;250  ;Leeching energy
id = 9110


[State 9105, DestroySelf]
type = DestroySelf
trigger1 = Root,StateNo=0

;----------------------------------------------------
;[MAJIN]
; Limiter Flames
[Statedef 9990]
type = S
velset = 0,0
sprpriority = 0
anim = 15999
ctrl = 0

[State 9990, Explod]
type = Explod
trigger1 = time = 0
anim = 8600
ID = 8600
pos = 5,-45  ;(enemynear,const(size.mid.pos.x))-20,(enemynear,const(size.mid.pos.y))-10
postype = p2
removetime = 120
sprpriority = 3
bindtime = -1
ownpal = 1
facing = IfElse(random<500,1,-1) ;-1

[State 9990, Explod]
type = Explod
trigger1 = time = 0
anim = 8601
ID = 8601
pos = 15,-10   ;(enemynear,const(size.mid.pos.x))-40,(enemynear,const(size.mid.pos.y))+10
postype = p2
removetime = 120
sprpriority = 3
bindtime = -1
ownpal = 1
facing = IfElse(random<500,1,-1) ;-1

[State 9990, Explod]
type = Explod
trigger1 = time = 0
anim = 8601
ID = 8602
pos = -15,-20   ;(enemynear,const(size.mid.pos.x))+10,(enemynear,const(size.mid.pos.y))-30
postype = p2
removetime = 120
sprpriority = 4
bindtime = -1
ownpal = 1
facing = IfElse(random<500,1,-1) ;-1

[State 9990, ModifyExplod]
type = ModifyExplod
trigger1 = time = [110,120]
anim = 8600
ID = 8600
pos = 5,-45
postype = p2
facing = IfElse(random<500,1,-1) ;-1
trans = addalpha
alpha = 256-25*(time-110),0+25*(time-110)

[State 9990, ModifyExplod]
type = ModifyExplod
trigger1 = time = [110,120]
anim = 8601
ID = 8601
pos = 15,-10
postype = p2
facing = IfElse(random<500,1,-1) ;-1
trans = addalpha
alpha = 256-25*(time-110),0+25*(time-110)

[State 9990, ModifyExplod]
type = ModifyExplod
trigger1 = time = [110,120]
anim = 8601
ID = 8602
pos = -15,-20
postype = p2
facing = IfElse(random<500,1,-1) ;-1
trans = addalpha
alpha = 256-25*(time-110),0+25*(time-110)


[State 9990, DestroySelf]
type = DestroySelf
trigger1 = time>=120
trigger2 = enemy,alive=0

;----------------------------------------------------
;[MAJIN]
;Super Limiter Timer
[Statedef 9999]
type    = S
movetype= I
physics = N
anim = 9999
sprpriority = 9

;ID:9992 Ex Royal Bullseye
;ID:9993 Elbows
;ID:9994 Air Machine Gun Tantrum
;ID:9995 Baku Lv1 (Normal Vegeta)
;ID:9996 Saiyan Pride Beatdown
;ID:9997 Machine Gun Temper
;ID:9998 Majin Bakuhatsuha
;ID:9999 Photon Bomber

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

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

[State 1061, End]
type = destroyself
trigger1 = !IsHelper(9992)
trigger1 = !IsHelper(9993)
trigger1 = !IsHelper(9994)
trigger1 = time>=120
trigger2 = IsHelper(9994) && enemynear,movetype!=H ;use Air MGT only once per combo
trigger3 = IsHelper(9993) && enemynear,movetype!=H ;use Elbow only once per combo
trigger4 = IsHelper(9992) && enemynear,movetype!=H ;use EX Royal Bullseye only once per combo

