;---------------------------------------------------------------------------------------------------
[Statedef 1001]
type    = S
movetype= A
physics = N
juggle  = 0;5
poweradd= 0
ctrl = 0
anim =1005
sprpriority = 6
;=======================================;
;PROJECTILE REFLECTION COMPATIBILITY    ;
;?????????????                   ;
;by Vans                                ;
;GUIDE:                                 ;
;FOR PROJECTILE / ?????              	;
;sysvar(0) = 131072                     ;
;sysvar(1) = REFLECTED_BEHAVIOR_STATE   ;
;=======================================;
[State 1005, COMPATIBILITY]
type = VarSet
trigger1 = !time 
sysvar(0) = 131072
[State 1005, REFLECTED STATE]
type = VarSet
trigger1 = !time
sysvar(1) = 10011

;=======================================;
[State 0, VarSet]
type = VarSet
trigger1 = time=0 && !var(25)
v = 0    
value =root,var(2)
;ignorehitpause = ;
;persistent = 

[State 0, VelSet]
type = VelSet
triggerall = !var(25)
trigger1 =time=0
;trigger2= root,numprojid(1001)=0
x = ifelse(var(0)=0,4.35,5.55)
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = S1000,0
channel = 1

[State 0, VarSet]
type = VarSet
trigger1 = 1
fv = 1    
value = vel x
ignorehitpause = 1
;persistent = 


[State 3005, hitoverride]
type=hitoverride
trigger1= 1
time=-1
attr=SCA,AA,AP,AT
stateno=1002

[State 0, HitBy]
type = HitBy
trigger1 = enemy,numproj=0
value = SCA,NP,SP,HP
;value2 = S,NA
time = 1
[State 0, HitBy]
type = notHitBy
trigger1 = enemy,numproj>0
value = SCA
;value2 = S,NA
time = 1

[State 0, AfterImage]
type = AfterImage
trigger1 =1
time = 99
length = 2
palcolor = 256
palbright = 0,0,0
palcontrast = 255,255,255
palpostbright = -15,-15,-15
paladd = 255,255,255
palmul = .5,1,1
timegap = 1
framegap = 1
trans = sub
ignorehitpause=1
[State 0, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 0
ignorehitpause = 1
persistent = 1

[State 0, VarSet]
type = VarSet
trigger1 = movecontact
v = 12    
value = 1
ignorehitpause = 1
[State 1005, This is for fossils]
type = Projectile
trigger1 = !time
ProjID = 1000
projanim =anim
projhitanim = -1
projremanim = -1
projscale = 0,0
offset=0,0
projpriority = 1
projremovetime = -1
postype = p1         ;p2,front,back,left,right
velocity = fvar(1),0

;[State 0, VelSet]
;type = VelSet
;
;trigger1 =movecontact && root,var(0)=2 
;x =2

[State 210, 2]
type = HitDef
triggerall = root,var(55)!=2
trigger1 =  time > 0 && !movecontact
attr = S, SP
animtype  = Medium
damage = floor(58*root,fvar(2)) ,10
guardflag = MA
priority=2
hitflag=MAF
pausetime = 1,12
sparkno = s4020
sparkxy = -10, -0
guard.sparkno=S6550
hitsound = S2,8
guardsound = S3,0
sparkxy = 0,-10
ground.type = High
getpower=0
givepower=0
ground.hittime =  20
guard.ctrltime=20
ground.slidetime =  6
ground.velocity = -4.06,0
air.velocity = -3.5,-4
air.hittime=18
fall.recovertime=(root,var(0)*999)+18
air.fall=1
guard.velocity = -6
airguard.velocity = -6,-1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
envshake.ampl = 3
envshake.time = 10
yaccel=.7
id=200
fall.xvelocity = -.5
fall.yvelocity = -5
[State 0, Explod]
type = Explod
trigger1 = movehit
anim = 6520+random%4
ID = 12000
pos = 5,-0
postype = p1 ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
persistent=0
ignorehitpause=1
[State 0, TargetState]
type = TargetState
triggerall = NumTarget(200)&&p2statetype=A
trigger1 =movehit&&p2movetype=H&&p2stateno!=[202,204]
value =202
ID = 200
;ignorehitpause = 
;persistent = 

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

[State 0, VarSet]
type = Varadd
trigger1 = movecontact=1 || root,numprojid(1000)=0
v = 2   
value = 1
ignorehitpause =0 
;ignorehitpause = 
;persistent = 

[State 1, VarSet]
type =parentVaradd
triggerall=var(10)=0
trigger1 =movecontact=1 
v = 18    ;v = 570
value = 1
ignorehitpause=1
[State 0, PowerAdd]
type = PowerAdd
trigger1 = var(2)
value = 105
ignorehitpause=1
persistent = 0

;[State 0, VarSet]
;type = parentVaradd
;triggerall=parent,var(10)=0
;trigger1 =movecontact=1 ||(root,numprojid(1000)=0)
;v = 57    ;v = 570
;value = ifelse((movehit=1||(root,numprojid(1000)=0)),ifelse(var(0)=2&&root,var(9)=1,35,67),ifelse(root,var(0)=2&&root,var(9)=1,4,23))
;ignorehitpause=1


;[State 0, VarSet]
;type = parentVaradd
;triggerall=parent,var(10)=0
;trigger1 =projcontact1002=1 
;v = 57    ;v = 570
;value = ifelse((movehit),25,12)
;ignorehitpause=1
;[State 0, VarSet]
;type = parentVaradd
;triggerall=parent,var(10)=0
;trigger1 =projcontact1003=1 
;v = 57    ;v = 570
;value = ifelse((movehit),10,5)
;ignorehitpause=1

;persistent = 


[State 0, DestroySelf]
type = DestroySelf
trigger1 = (frontedgedist <= -40 || backedgedist <= -40) && time > 5

[State 210, 5]
type = ChangeState
trigger1 = (movecontact)
trigger2= root,numprojid(1000)=0 
value = 1002
;---------------------------------------------------------------------------------------------------
[Statedef 10011]
type    = S
movetype= A
physics = N
juggle  = 0;5
poweradd= 0
ctrl = 0
sprpriority = 6
;=======================================;
;PROJECTILE REFLECTION COMPATIBILITY    ;
;?????????????                   ;
;by Vans                                ;
;GUIDE:                                 ;
;FOR PROJECTILE / ?????              	;
;sysvar(0) = 131072                     ;
;sysvar(1) = REFLECTED_BEHAVIOR_STATE   ;
;=======================================;
[State 1005, COMPATIBILITY]
type = VarSet
trigger1 = !time 
sysvar(0) = 131072
[State 1005, REFLECTED STATE]
type = VarSet
trigger1 = !time
sysvar(1) = 1001

;=======================================;

;ignorehitpause = ;
;persistent = 

[State 0, VelSet]
type = VelSet
trigger1 = vel x <0 
x = -vel x

[State 0, VarSet]
type = VarSet
trigger1 = 1
fv = 1    
value = vel x
ignorehitpause = 1
;persistent = 


[State 3005, hitoverride]
type=hitoverride
trigger1= 1
time=-1
attr=SCA,AA,AP,AT
stateno=1002

[State 0, HitBy]
type = HitBy
trigger1 = enemy,numproj=0
value = SCA,NP,SP,HP
;value2 = S,NA
time = 1
[State 0, HitBy]
type = notHitBy
trigger1 = enemy,numproj>0
value = SCA
;value2 = S,NA
time = 1

[State 0, AfterImage]
type = AfterImage
trigger1 =1
time = 99
length = 2
palcolor = 256
palbright = 0,0,0
palcontrast = 255,255,255
palpostbright = -15,-15,-15
paladd = 255,255,255
palmul = .5,1,1
timegap = 1
framegap = 1
trans = sub
ignorehitpause=1
[State 0, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 0
ignorehitpause = 1
persistent = 1

[State 0, VarSet]
type = VarSet
trigger1 = movecontact
v = 12    
value = 1
ignorehitpause = 1
[State 1005, This is for fossils]
type = Projectile
trigger1 = !time
ProjID = 1001
affectteam=f
projanim =anim
projhitanim = -1
projremanim = -1
projscale = 0,0
offset=0,0
projpriority = 1
projremovetime = -1
postype = p1         ;p2,front,back,left,right
velocity = fvar(1),0

;[State 0, VelSet]
;type = VelSet
;
;trigger1 =movecontact && root,var(0)=2 
;x =2

[State 210, 2]
type = HitDef
triggerall = root,var(5)=0
trigger1 =  time > 0 && !movecontact
attr = S, SP
affectteam=f
animtype  = Medium
damage = floor(58*root,fvar(2)) ,10
guardflag = MA
priority=2
hitflag=MAF
pausetime = 1,12
sparkno = s4020
guard.sparkno = s4120
hitsound = S2,8
guardsound = S3,0
sparkxy = 0,-10
ground.type = High
getpower=0
givepower=0
ground.hittime =  20
guard.ctrltime=20
ground.slidetime =  6
ground.velocity = -7,0
air.velocity = -3.5,-4
air.hittime=18
fall.recovertime=18
air.fall=1
guard.velocity = -6
airguard.velocity = -6,-1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
envshake.ampl = 3
envshake.time = 10
yaccel=.7
id=200
fall.xvelocity = -.5
fall.yvelocity = -5

[State 0, TargetState]
type = TargetState
triggerall = NumTarget(200)&&root,statetype=A
trigger1 =movehit&&root,movetype=H&&root,stateno!=[202,204]
value =202
ID = 200
;ignorehitpause = 
;persistent = 

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

[State 0, VarSet]
type = Varadd
trigger1 = movecontact=1 || root,numprojid(1001)=0
v = 2   
value = 1
ignorehitpause =0 
;ignorehitpause = 
;persistent = 

[State 1, VarSet]
type =parentVaradd
triggerall=var(10)=0
trigger1 =movecontact=1 
v = 18    ;v = 570
value = 1
ignorehitpause=1
;[State 0, PowerAdd]
;type = PowerAdd
;trigger1 = movecontact=1 ||(root,numprojid(1000)=0)
;value = 105
;ignorehitpause=1
;persistent = 

;[State 0, VarSet]
;type = parentVaradd
;triggerall=parent,var(10)=0
;trigger1 =movecontact=1 ||(root,numprojid(1000)=0)
;v = 57    ;v = 570
;value = ifelse((movehit=1||(root,numprojid(1000)=0)),ifelse(var(0)=2&&root,var(9)=1,35,67),ifelse(root,var(0)=2&&root,var(9)=1,4,23))
;ignorehitpause=1


;[State 0, VarSet]
;type = parentVaradd
;triggerall=parent,var(10)=0
;trigger1 =projcontact1002=1 
;v = 57    ;v = 570
;value = ifelse((movehit),25,12)
;ignorehitpause=1
;[State 0, VarSet]
;type = parentVaradd
;triggerall=parent,var(10)=0
;trigger1 =projcontact1003=1 
;v = 57    ;v = 570
;value = ifelse((movehit),10,5)
;ignorehitpause=1

;persistent = 


[State 0, DestroySelf]
type = DestroySelf
trigger1 = (frontedgedist <= -40 || backedgedist <= -40) && time > 5

[State 210, 5]
type = ChangeState
trigger1 = (movecontact)
trigger2= root,numprojid(1001)=0 
value = 1002
;--------------------------------------------------------------------------------------------
[Statedef 1002]
type    = S
movetype= I
physics = N
juggle  = 4
poweradd= 0
ctrl = 0
velset = 0,0
anim =10000
sprpriority = 2
[State 0, PowerAdd]
type = PowerAdd
triggerall=root,var(10)=0 && prevstateno!=3001
trigger1 = !var(2)
value =105
ignorehitpause=1
persistent =0 

;[State 0, VarSet]
;type = parentVaradd
;triggerall=root,var(10)=0
;trigger1 = !var(12)
;v = 57    ;v = 570
;value = ifelse((movehit),ifelse(root,var(0)=2&&root,var(9)=1,27,30),ifelse(root,var(0)=2&&root,var(9)=1,4,10))
;ignorehitpause=1
[State 0, ParentVarSet]
type = ParentVarSet
trigger1 = 1
v =  25   ;fv = 
value = 0

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

[State 0, Explod]
type = Explod
trigger1 =time=0&& prevstateno!=3001
anim =1006
ID =1001
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 2
vel = 0,0
accel = 0,0
random = 0,0
scale = .5,.5
sprpriority = 2
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 0, Explod]
type = Explod
trigger1 = time=0&& prevstateno!=3001
anim =1007
ID =1001
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 2
vel = 0,0
accel = 0,0
random = 0,0
scale = .5,.5
sprpriority = 1
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1

[State 0, Explod]
type = Explod
trigger1 =time=0&& prevstateno=3001
anim =3006
ID =1001
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 2
vel = 0,0
accel = 0,0
random = 0,0
scale = .5,.5
sprpriority = 2
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 0, Explod]
type = Explod
trigger1 = time=0&& prevstateno=3001
anim =3007
ID =1001
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 2
vel = 0,0
accel = 0,0
random = 0,0
scale = .5,.5
sprpriority = 1
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 210, 5]
type = destroyself
trigger1 =!numtarget || root,movecontact 
;---------------------------------------------------------------------------------------------------
[Statedef 1010]
type    = S
movetype= A
physics = N
juggle  = 0;5
poweradd= 0
ctrl = 0
anim =1020+root,var(2)
sprpriority = 6
[State 3005, hitoverride]
type=hitoverride
trigger1= 1
time=-1
attr=SCA,AA,AP,AT
stateno=1010
[State 0, HitBy]
type = HitBy
trigger1 = 1
value = SCA,AP
;value2 = S,NA
time = 1
ignorehitpause = 1
;persistent = 
[State 1005, This is for fossils]
type = Projectile
trigger1 = !time
ProjID = 1000
projanim =anim
projhitanim = -1
projremanim = -1
projscale = 0,0
offset=0,0
projpriority = 5
projremovetime = 4
postype = p1         ;p2,front,back,left,right
velocity = fvar(1),0
[State 210, 5]
type = destroyself
trigger1 =root,animelemtime(5)>=0 && root,stateno=1000
trigger2=root,movetype=H
trigger3 = roundstate!=2
trigger4= root,stateno!=1000
;---------------------------------------------------------------------------------------------------
[Statedef 3001]
type    = S
movetype= A
physics = N
juggle  = 0;5
poweradd= 0
ctrl = 0
anim =3005
sprpriority = 6
;=======================================;
;PROJECTILE REFLECTION COMPATIBILITY    ;
;?????????????                   ;
;by Vans                                ;
;GUIDE:                                 ;
;FOR PROJECTILE / ?????              	;
;sysvar(0) = 131072                     ;
;sysvar(1) = REFLECTED_BEHAVIOR_STATE   ;
;=======================================;
[State 1005, COMPATIBILITY]
type = VarSet
trigger1 = !time 
sysvar(0) = 131072
[State 1005, REFLECTED STATE]
type = VarSet
trigger1 = !time
sysvar(1) = 10011

;=======================================;
[State 0, VarSet]
type = VarSet
trigger1 = time=0
v = 0    
value =root,var(2)
[State 0, VarSet]
type = VarSet
trigger1 = time=0
v = 1    
value =root,var(4)||root,numhelper(3001)>1
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = S3001,1
channel = 0
[State 0, VelSet]
type = VelSet
trigger1 =time=0
;trigger2= root,numprojid(1001)=0
x = cond(var(1),13,ifelse(var(0)=0,5.35,10.55))


[State 0, VarSet]
type = VarSet
trigger1 = 1
fv = 1    
value = vel x
ignorehitpause = 1
;persistent = 


[State 3005, hitoverride]
type=hitoverride
trigger1= 1
time=-1
attr=SCA,AA,AP,AT
stateno=1002

[State 0, HitBy]
type = HitBy
trigger1 = enemy,numproj=0
value = SCA,NP,SP,HP
;value2 = S,NA
time = 1
[State 0, HitBy]
type = notHitBy
trigger1 = enemy,numproj>0
value = SCA
;value2 = S,NA
time = 1

[State 0, AfterImage]
type = AfterImage
trigger1 =1
time = 99
length = 2
palcolor = 256
palbright = 0,0,0
palcontrast = 255,255,255
palpostbright = -15,-15,-15
paladd = 255,255,255
palmul = .5,1,1
timegap = 1
framegap = 1
trans = sub
ignorehitpause=1
[State 0, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 0
ignorehitpause = 1
persistent = 1

[State 0, VarSet]
type = VarSet
trigger1 = movecontact
v = 12    
value = 1
ignorehitpause = 1
[State 1005, This is for fossils]
type = Projectile
trigger1 = !time
ProjID = 1000
projanim =anim
projhitanim = -1
projremanim = -1
projscale = 0,0
offset=0,0
projpriority = 3
projremovetime = -1
postype = p1         ;p2,front,back,left,right
velocity = fvar(1),0

;[State 0, VelSet]
;type = VelSet
;
;trigger1 =movecontact && root,var(0)=2 
;x =2

[State 210, 2]
type = HitDef
trigger1 =  time > 0 && !movecontact
attr = S, HP
animtype  = Medium
damage = floor(cond(root,var(4),135,215)*root,fvar(2)) ,15
guardflag = MA
priority=2
hitflag=MAF
pausetime = 1,8
sparkno =-1;s4020
sparkxy = -10, -0
guard.sparkno=S6550
hitsound = S2,7
guardsound = 6,1
sparkxy = 0,-10
ground.type = High
getpower=0
givepower=0
ground.hittime =  20
guard.ctrltime=20
ground.slidetime =  6
ground.velocity = -7,-5
air.velocity = -6.5,-4
air.hittime=18
fall.recovertime=(root,var(0)*999)+18
fall=1
guard.velocity = -3.5
airguard.velocity = -6,-1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
envshake.ampl = 4
envshake.time = 8
yaccel=.7
id=200
fall.xvelocity = -.5
fall.yvelocity = -5
[State 0, Explod]
type = Explod
trigger1 = movehit 
anim = 6510+random%4
ID = 12000
pos = 5,-0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
persistent=0
ignorehitpause=1
[State 0, TargetState]
type = TargetState
triggerall = NumTarget(200)&&p2statetype=A
trigger1 =movehit&&p2movetype=H&&p2stateno!=[20005,20006]
value =20005
ID = 200
;ignorehitpause = 
;persistent = 

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

[State 0, VarSet]
type = Varadd
trigger1 = movecontact=1 || root,numprojid(1000)=0
v = 2   
value = 1
ignorehitpause =0 
;ignorehitpause = 
;persistent = 

[State 1, VarSet]
type =parentVaradd
triggerall=var(10)=0
trigger1 =movecontact=1 
v = 18    ;v = 570
value = 1
ignorehitpause=1

;persistent = 

;[State 0, VarSet]
;type = parentVaradd
;triggerall=parent,var(10)=0
;trigger1 =movecontact=1 ||(root,numprojid(1000)=0)
;v = 57    ;v = 570
;value = ifelse((movehit=1||(root,numprojid(1000)=0)),ifelse(var(0)=2&&root,var(9)=1,35,67),ifelse(root,var(0)=2&&root,var(9)=1,4,23))
;ignorehitpause=1


;[State 0, VarSet]
;type = parentVaradd
;triggerall=parent,var(10)=0
;trigger1 =projcontact1002=1 
;v = 57    ;v = 570
;value = ifelse((movehit),25,12)
;ignorehitpause=1
;[State 0, VarSet]
;type = parentVaradd
;triggerall=parent,var(10)=0
;trigger1 =projcontact1003=1 
;v = 57    ;v = 570
;value = ifelse((movehit),10,5)
;ignorehitpause=1

;persistent = 


[State 0, DestroySelf]
type = DestroySelf
trigger1 = (frontedgedist <= -40 || backedgedist <= -40) && time > 5

[State 210, 5]
type = ChangeState
trigger1 = (movecontact)
trigger2= root,numprojid(1000)=0 
value = 1002
;---------------------------------------------------------------------------------------------------
[Statedef 6000]
type    = A
movetype= I
physics = N
juggle  = 8
velset=0,0
poweradd= 0
ctrl = 0
anim =10000
sprpriority = 9
[State 0, VarSet]
type = parentVaradd
trigger1 = root,var(59)<30000
trigger1 = time%60=0 && roundstate=2
v = 59    
value = 294
[State 0, VarAdd]
type = parentVarAdd
trigger1 = root,var(59)<30000
trigger1 = root,stateno=150||root,stateno=152||root,stateno=154
trigger1 = root,time=1
v = 59
value = cond(root,statetype=C,850,650)
ignorehitpause=1
[State 0, VarSet]
type = VarSet
trigger1 =p2movetype!=H 
fv = 15    ;fv = 10
value = 1
[State 0, VarSet]
type = VarSet
trigger1 =root,stateno=715
fv = 15    ;fv = 10
value = .5

[State 0, VarAdd]
type = parentVarset
trigger1 = root,var(59)>30000
trigger2=root,var(58) && p2movetype!=H&&root,movetype=I && root,numhelper(6100)=0 &&root,stateno<=5200&& root,stateno!=[700,715]
v = 59
value = 30000
ignorehitpause=1
[State 0, VarSet]
type = VarSet
trigger1 =(enemy,hitdefattr!=SCA,HA,HP,HT && root,movetype!=H  && !var(40)) ||root,hitover  &&var(40)=2               
v = 40    ;fv = 10
value = 1
[State 0, VarSet]
type = VarSet
trigger1 =root,gethitvar(hitshaketime)>0 &&root,hitfall&& !root,hitover && !root,gethitvar(isbound) && var(40)=1                   
v = 40    ;fv = 10
value = 2
[State 0, VarSet]
type = VarSet
trigger1 =enemy,hitdefattr=SCA,HA,HP,HT 
trigger2= root,stateno=5211
trigger3 = root,gethitvar(isbound)
v = 40    ;fv = 10
value = 0


[State 0, VarSet];offsetx
type = VarSet
trigger1 = 1
v = 10    
value = helper(10000),var(10)
[State 0, VarSet];offsety
type = VarSet
trigger1 = 1
v = 11   
value =  helper(10000),var(11)
[State 0, VarSet];scalingx
type = VarSet
trigger1 = 1
fv = 10    
value = helper(10000),fvar(10)
[State 0, Explod]
type = Explod
trigger1 = time=0
anim = 12000
ID = 12000
pos = 75+var(10),220+var(11)
postype = back  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
pausemovetime = 0
scale = fvar(10),fvar(10)
sprpriority = 7
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0

[State 0, Explod]
type = Explod
trigger1 = time=0
anim = 12001
ID = 12000
pos = 75+var(10),220+var(11)
postype = back  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
pausemovetime = 0
scale = fvar(10),fvar(10)
sprpriority =4
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0

[State 0, Explod]
type = Explod
trigger1 = !numexplod(12004) &&( root,var(59)<30000||root,power<3000)
anim = 12005+(teamside=2)
ID = 12004
pos = 25+var(10),220+var(11)
postype = back  ;p2,front,back,left,right
facing = cond(teamside=2,-1,1)
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
pausemovetime = 0
scale = fvar(10),fvar(10)
sprpriority = 9
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = ( root,var(59)=30000&&root,power=3000)
id = 12004
;ignorehitpause = 
;persistent = 
[State 0, Helper]
type = Helper
trigger1 =root,numhelper(6001)=0
helpertype = normal ;player
name = "gauges"
ID =  6001
stateno = 6001
pos = 61,-37
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
size.xscale =1*const(size.xscale)
size.yscale =1*const(size.yscale)
ignorehitpause=1
[State 0, Explod]
type = Explod
triggerall = numexplod(12015)=0
trigger1 = root,power >=1000 && root,var(59)>=10000
anim = 12015;+(teamside=2)
ID = 12015
pos = 75+var(10),220+var(11)
postype = back  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
pausemovetime = 0
scale = fvar(10),fvar(10)
sprpriority = 8
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0



[State 0, Explod]
type = Explod
triggerall = numexplod(12016)=0
trigger1 = root,power >=2000 && root,var(59)>=20000
anim = 12016;+(teamside=2)
ID = 12016
pos = 104+var(10),218+var(11)
postype = back  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
pausemovetime = 0
scale = fvar(10),fvar(10)
sprpriority = 8
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
[State 0, Explod]
type = Explod
triggerall = numexplod(12017)=0
trigger1 = root,power =3000 && root,var(59)=30000
anim = 12016;+(teamside=2)
ID = 12017
pos = 133+var(10),216+var(11)
postype = back  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
pausemovetime = 0
scale = fvar(10),fvar(10)
sprpriority = 8
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = root,power <1000 ||root,var(59)<10000
id = 12015
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = root,power <2000 ||root,var(59)<20000
id = 12016

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = root,power <3000 ||root,var(59)<30000
id = 12017

[State 0, VarSet]
type = VarSet
trigger1 = root,var(59)=30000 && power=3000
v = 35   ;fv = 10
value = (((var(20)%100)-(var(20)%10))/10)
;ignorehitpause = 
;persistent = 

[State 0, RemapPal]
type = RemapPal
trigger1 = root,power=3000&&root,var(59)=30000
source = 3,10
dest = 2,var(35)

[State 0, RemapPal]
type = RemapPal
trigger1 = power<3000||root,var(59)<30000
source = 3,10
dest = 3,10
[State 0, RemapPal]
type = RemapPal
trigger1 = root,power=3000&&root,var(59)=30000
source = 0,8
dest = 2,var(35)

[State 0, RemapPal]
type = RemapPal
trigger1 = power<3000||root,var(59)<30000
source = 0,8
dest = 0,8

[State 0, Explod]
type = Explod
triggerall=power<1000|| power=3000&&root,var(59)=30000
trigger1 =1
anim = 12010
ID = 12010
pos = 34+var(10),219+var(11)
postype = back  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = 1
pausemovetime = 2
supermovetime=2
scale = fvar(10),fvar(10)
sprpriority =6
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = (power=[1000,1999]) 
id = 12010
;ignorehitpause = 
;persistent = 

;full bar
[State 0, Explod]
type = Explod
triggerall=power>=1000
trigger1=power <3000 || root,var(59)<30000
trigger1 = numexplod(2014)=0
anim = 12012
ID = 2014
pos = 34+var(10),219+var(11)
postype = back  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
pausemovetime = 2
supermovetime=2
scale = fvar(10),fvar(10)
sprpriority =7
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = power <1000 || root,var(59)=30000 && power=3000
id = 2014

[State 0, Explod]
type = Explod
triggerall=power<2000|| power=3000&&root,var(59)=30000
trigger1 =1
anim = 12010
ID = 12011
pos = 63+var(10),217+var(11)
postype = back  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = 1
pausemovetime = 2
supermovetime=2
scale = 0,fvar(10)
sprpriority =6
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
;full bar
[State 0, Explod]
type = Explod
triggerall=power>=2000
trigger1=power <3000 || root,var(59)<30000
trigger1 = numexplod(2013)=0
anim = 12012
ID = 2013
pos =  63+var(10),217+var(11)
postype = back  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
pausemovetime = 2
supermovetime=2
scale = fvar(10),fvar(10)
sprpriority =7
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = power <2000 || root,var(59)=30000 && power=3000
id = 2013
[State 0, Explod]
type = Explod
trigger1=power <3000 || power=3000&&root,var(59)=30000
trigger1 = 1
anim = 12010
ID = 12012
pos = 91+var(10),215+var(11)
postype = back  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = 1
pausemovetime = 2
supermovetime=2
scale = 0,fvar(10)
sprpriority =6
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0

;full bar
[State 0, Explod]
type = Explod
trigger1=power =3000 && root,var(59)<30000
trigger1 = numexplod(2012)=0
anim = 12012
ID = 2012
pos =  91+var(10),215+var(11)
postype = back  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
pausemovetime = 2
supermovetime=2
scale = fvar(10),fvar(10)
sprpriority =7
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = power <3000 || root,var(59)=30000 && power=3000
id = 2012


[State 0, VarSet]
type = Varadd
trigger1 =  root,power=3000&&root,var(59)=30000
trigger1= var(21)=0
v = 20   ;fv = 10
value = 1
[State 0, VarSet]
type = Varadd
trigger1 =  root,power=3000&&root,var(59)=30000
trigger1= var(21)=1
v = 20   ;fv = 10
value = -1
[State 0, VarSet]
type = Varset
trigger1 =  root,power=3000&&root,var(59)=30000
trigger1= var(20)=59
v = 21   ;fv = 10
value = 1
[State 0, VarSet]
type = Varset
trigger1 =  root,power=3000&&root,var(59)=30000
trigger1= var(20)=0
v = 21   ;fv = 10
value = 0

[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = root,power=[0,1000]
ID =12010
scale = (fvar(10)*(root,power*.001)),fvar(10)
[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = root,power>1000
ID =12010
scale = fvar(10),fvar(10)
[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = root,power=[1000,2000]
ID =12011
scale = (fvar(10)*((root,power-1000)*.001)),fvar(10)
[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = root,power>2000
ID =12011
scale = fvar(10),fvar(10)
[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = root,power<1000
ID =12011
scale = 0,fvar(10)
[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = power=[2000,3000]
ID =12012
scale =  ((fvar(10)+.002)*((root,power-2000)*.001)),fvar(10)
[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = root,power<2000
ID =12012
scale = 0,fvar(10)



[State 0, Explod]
type = Explod
triggerall=root,var(59)<10000|| power=3000&&root,var(59)=30000
trigger1 = 1
anim = 12011
ID = 12020
pos = 30+var(10),223+var(11)
postype = back  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = 1
pausemovetime = 0
scale = fvar(10),fvar(10)
sprpriority =6
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0


[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = root,var(59)=[10000,19999]
id = 12020
;ignorehitpause = 
;persistent = 

;full bar blue
[State 0, Explod]
type = Explod
triggerall=root,var(59)>=10000
trigger1=power <3000 || root,var(59)<30000
trigger1 = numexplod(2002)=0
anim = 12013
ID = 2002
pos =  30+var(10),223+var(11)
postype = back  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
pausemovetime = 2
supermovetime=2
scale = fvar(10),fvar(10)
sprpriority =7
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =root,var(59) <10000 || root,var(59)=30000 && power=3000
id = 2002

[State 0, Explod]
type = Explod
triggerall=root,var(59)<20000|| power=3000&&root,var(59)=30000
trigger1 = 1
anim = 12011
ID = 12021
pos = 59+var(10),221+var(11)
postype = back  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = 1
pausemovetime = 0
scale =0,fvar(10)
sprpriority =6
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0

;full bar blue
[State 0, Explod]
type = Explod
triggerall=root,var(59)>=20000
trigger1=power <3000 || root,var(59)<30000
trigger1 = numexplod(2003)=0
anim = 12013
ID = 2003
pos =59+var(10),221+var(11)
postype = back  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
pausemovetime = 2
supermovetime=2
scale = fvar(10),fvar(10)
sprpriority =7
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =root,var(59) <20000 || root,var(59)=30000 && power=3000
id = 2003

[State 0, Explod]
type = Explod
trigger1=power <3000 || root,var(59)<30000|| power=3000&&root,var(59)=30000
trigger1 =1
anim = 12011
ID = 12022
pos = 88+var(10),219+var(11)
postype = back  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = 1
pausemovetime = 0
scale = 0,fvar(10)
sprpriority =6
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0

;full bar blue
[State 0, Explod]
type = Explod
triggerall=root,var(59)=30000
trigger1=power <3000
trigger1 = numexplod(2004)=0
anim = 12013
ID = 2004
pos = 88+var(10),219+var(11)
postype = back  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
pausemovetime = 2
supermovetime=2
scale = fvar(10),fvar(10)
sprpriority =7
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =root,var(59) <30000 || root,var(59)=30000 && power=3000
id = 2004

[State 0, PlaySnd]
type = PlaySnd
trigger1 = numexplod(1000)=0&& root,var(59)=[10000,19999]
value = S2000,0
channel=4
[State 0, PlaySnd]
type = PlaySnd
trigger1 = numexplod(1001)=0&& root,var(59)=[20000,29999]
value = S2000,0
channel=4
[State 0, PlaySnd]
type = PlaySnd
trigger1 = numexplod(1002)=0&& root,var(59)=30000
value = S2000,0
channel=4
[State 0, Explod]
type = Explod
trigger1 =numexplod(1000)=0
anim = 10000
ID = 1000
pos = 88+var(10),219+var(11)
postype = back  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
pausemovetime = 0
scale = 0,0
sprpriority =-9
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
[State 0, Explod]
type = Explod
trigger1 =numexplod(1001)=0
anim = 10000
ID = 1001
pos = 88+var(10),219+var(11)
postype = back  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
pausemovetime = 0
scale = 0,0
sprpriority =-9
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
[State 0, Explod]
type = Explod
trigger1 =numexplod(1002)=0
anim = 10000
ID = 1002
pos = 88+var(10),219+var(11)
postype = back  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
pausemovetime = 0
scale = 0,0
sprpriority =-9
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = root,var(59)<10000
id = 1000
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = root,var(59)<20000
id = 1001
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = root,var(59)<30000
id = 1002
;ignorehitpause = 
;persistent = 
[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = root,var(59)=[0,10000]
ID =12020
scale = (fvar(10)*(root,var(59)*.000095)),fvar(10)
[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = root,var(59)>10000
ID =12020
scale = fvar(10),fvar(10)
[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = root,var(59)=[10000,20000]
ID =12021
scale = (fvar(10)*((root,var(59)-10000)*.000095)),fvar(10)
[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = root,var(59)>20000
ID =12021
scale = fvar(10),fvar(10)
[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = root,var(59)<10000
ID =12021
scale = 0,fvar(10)
[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = root,var(59)=[20000,30000]
ID =12022
scale =  ((fvar(10)+.002)*((root,var(59)-20000)*.000095)),fvar(10)
[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = root,var(59)<20000
ID =12022
scale = 0,fvar(10)

;---------------------------------------------------------------------------------------------------
[Statedef 6001]
type    = A
movetype= I
physics = N
juggle  = 8
velset=0,0
poweradd= 0
ctrl = 0
anim =10000
sprpriority = 9
[State 0, VarSet]
type = VarSet
trigger1 = time=0
v = 10    
value = parent,var(10)
[State 0, VarSet]
type = VarSet
trigger1 = time=0
v = 11    
value = parent,var(11)
[State 0, VarSet]
type = VarSet
trigger1 = time=0
fv = 10    
value = parent,fvar(10)
;[State 0, RemapPal]
;type = RemapPal
;trigger1 = root,power=3000&&root,var(59)=30000
;source = 3,0
;dest = 3,(((parent,var(20)%100)-(parent,var(20)%10))/10)
;
;[State 0, RemapPal]
;type = RemapPal
;trigger1 = root,power<3000||root,var(59)<30000
;source = 3,0
;dest = 3,0
[State 0, Explod]
type = Explod
trigger1 =numexplod(12004)=0
anim = 12007
ID = 12004
pos = 42+var(10),213+var(11)
postype = back  ;p2,front,back,left,right
facing = cond(teamside=2,-1,1)
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
pausemovetime = 0
scale = fvar(10),fvar(10)
sprpriority = 8
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
[State 0, Explod]
type = Explod
trigger1 =numexplod(12004)=1
anim = 12008
ID = 12004
pos = 42+var(10),213+var(11)
postype = back  ;p2,front,back,left,right
facing = cond(teamside=2,-1,1)
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
pausemovetime = 0
scale = fvar(10),fvar(10)
sprpriority = 9
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = ( root,var(59)<30000||root,power<3000)
id = 12004
;-----------------------8.5seconds 
;install
[Statedef 6101]
type    = A
movetype= I
physics = N
juggle  = 8
velset=0,0
poweradd= 0
ctrl = 0
anim =10000
sprpriority =0
[State 0, VarSet]
type = VarSet
trigger1 = time=0
v = 0    ;fv = 10
value = 510
[State 0, VarSet]
type = VarSet
trigger1 = time=0||root,stateno=710||root,stateno=715||root,stateno=[3000,3100]
v = 30   ;fv = 10
value = power
;ignorehitpause = 
;persistent = 
[State 0, PowerSet]
type = PowerSet
trigger1 = time>0
value =var(30)
ignorehitpause = 1
;persistent = 

[State 0, VarSet]
type = Varadd
trigger1 = root,stateno!=4000
v = 0    ;fv = 10
value = -1
[State 0, VarSet]
type = Varset
triggerall = root,movetype!=H
trigger1 = root,prevstateno=[3000,3100]
trigger2 = roundstate!=2
v = 0    ;fv = 10
value = 0
[State 0, VarSet]
type = Varset
trigger1 = !root,alive
v = 0    ;fv = 10
value = 0
[State 0, VarSet]
type = VarSet
trigger1 = time=0
v = 10    ;fv = 10
value = helper(6000),var(10)
[State 0, VarSet]
type = VarSet
trigger1 = time=0
v = 11    ;fv = 10
value = helper(6000),var(11)
[State 0, VarSet]
type = VarSet
trigger1 = time=0
fv = 10    ;fv = 10
value = helper(6000),fvar(10)

[State 0, Explod]
type = Explod
trigger1 = time=0
anim = 7001
ID = 12020
pos = 160,120
postype = back  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
pausemovetime = 99
supermovetime=99
scale = .5,.5
sprpriority = -8
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
[State 0, Explod]
type = Explod
trigger1 = time=0
anim = 7003
ID = 12020
pos = 160,120
postype = back  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
pausemovetime = 99
supermovetime=99
scale = .5,.5
sprpriority = -7
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
;[State 0, Explod]
;type = Explod
;triggerall = time>3
;trigger1 = time%4=0
;anim = 7002
;ID = 12020
;pos = -160,120
;postype = back  ;p2,front,back,left,right
;facing = 1
;vfacing = 1
;bindtime = 1
;vel = 4+(random%5),0
;accel = 0,0
;random = 0,210
;removetime = 120
;pausemovetime = 99
;supermovetime=99
;scale = .5,.3-(random%8)*.005
;sprpriority = -7
;ontop = 0
;shadow = 0,0,0
;ownpal = 1
;removeongethit = 0
;
[State 0, Explod]
type = Explod
trigger1 = time=0
anim = 7010
ID = 12020
pos = 65+var(10),60+var(11)
postype = back  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
pausemovetime = 99
scale = fvar(10),fvar(10)
sprpriority = 7
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
;
[State 0, Explod]
type = Explod
trigger1 = time=0
anim = 7011
ID = 12020
pos = 65+var(10),60+var(11)
postype = back  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
pausemovetime = 99
scale = fvar(10),fvar(10)
sprpriority =6
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0

[State 0, Explod]
type = Explod
trigger1 = time=0
anim = 7012
ID = 12021
pos = 29+var(10),58+var(11)
postype = back  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
pausemovetime = 99
scale = fvar(10),fvar(10)
sprpriority =8
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = var(0)=0
id = 12020

[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = 1
ID =12021
scale = ((fvar(10))*(var(0)*0.00196)),.5

[State 0, VarSet]
type = parentVarSet
trigger1 =root,stateno=4000 
v =4    ;fv = 10
value = 1

[State 0, VarSet]
type = parentVarSet
trigger1 =var(0)=0
v = 4    ;fv = 10
value = 0

[State 0, DestroySelf]
type = DestroySelf
trigger1 = var(0)=0
;---------------------------------------------------------------------------------------------------
;bgs
[Statedef 6100]
type    = A
movetype= I
physics = N
juggle  = 8
velset=0,0
poweradd= 0
ctrl = 0
anim =10000
sprpriority =0

[State 0, Explod]
type = Explod
trigger1 = time=0
anim = 12050
ID = 12020
pos = 160,120
postype = back  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = 10
pausemovetime = 99
supermovetime=99
scale = .5,.5
sprpriority = -6
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = time<10
ID =12020
scale = .5,.5-(time*.05)
ignorehitpause=1
[State 0, DestroySelf]
type = DestroySelf
trigger1 = time=10
;ignorehitpause = 
;persistent = 
;---------------------------------------------------------------------------------------------------
;bgs
[Statedef 6200]
type    = A
movetype= I
physics = N
juggle  = 8
velset=0,0
poweradd= 0
ctrl = 0
anim =10000
sprpriority =0
[State 0, VarSet]
type = VarSet
trigger1 =time=0
v = 0    ;fv = 10
value =1
[State 0, VarSet]
type = VarSet
triggerall=var(0)=1
trigger1 = root,stateno=[5000,5100]
trigger2= root,gethitvar(isbound)
trigger3 = root,life < root,lifemax && enemy,movehit 
v = 0    ;fv = 10
value = -1
[State 0, VarSet]
type = VarSet
triggerall=var(0)=1
trigger1 = root,movehit
trigger2= helper(10003),var(58)>0 && p2stateno!=[120,155]
v = 0    ;fv = 10
value =0
[State 0, VarSet]
type = VarSet
trigger1 = !root,movehit&& helper(10003),var(58)=0
v = 1   ;fv = 10
value = p2movetype=A

;reversal
[State 0, VarSet]
type = VarSet
triggerall = root,statetype!=A && p2stateno!=[120,155]
trigger1 = root,stateno=0&&(root,prevstateno=[5000,5120])
v = 2   ;fv = 10
value = root,time<3



[State 0, Explod]
type = Explod
triggerall = var(0)=0
trigger1 = root,life = lifemax &&  enemy,gethitvar(hitshaketime)>-1 && enemy,stateno!=[120,155]
anim = 8002+(teamside=2)*10
ID = 8002
pos = -10,60
postype = back  ;p2,front,back,left,right
facing = cond(teamside=2,-1,1)
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
supermovetime=99
scale = .5,.5
sprpriority = -6
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
persistent=0
[State 0, VarSet]
type = VarSet
trigger1 = 1
v = 40    ;fv = 10
value = (numexplod(8001))+(numexplod(8002))+(numexplod(8005))

[State 0, Explod]
type = Explod
trigger1 = root,stateno=715 &&root,time=1
anim = 8000+(teamside=2)*10
ID = 8002
pos = -10,60+(var(40)*10)
postype = back  ;p2,front,back,left,right
facing =cond(teamside=2,-1,1)
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
supermovetime=99
scale = .5,.5
sprpriority = -6
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0




[State 0, Explod]
type = Explod
trigger1 = root,stateno=705 &&root,time=1
anim = 8003+(teamside=2)*10
ID = 8002
pos = -10,60+(var(40)*10)
postype = back  ;p2,front,back,left,right
facing= cond(teamside=2,-1,1)
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
supermovetime=99
scale = .5,.5
sprpriority = -6
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
[State 0, Explod]
type = Explod
trigger1 = root,stateno=710 &&root,time=1
anim = 8004+(teamside=2)*10
ID = 8002
pos = -10,60+(var(40)*10)
postype = back  ;p2,front,back,left,right
facing =cond(teamside=2,-1,1)
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
supermovetime=99
scale = .5,.5
sprpriority = -6
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0


[State 0, Explod]
type = Explod
triggerall = numexplod(8005)=0
trigger1 = root,movecontact=1 && root,hitcount=1
trigger1 = helper(10003),var(9)
anim = 8006+(teamside=2)*10
ID = 8005
pos = -10,60+(var(40)*10)
postype = back  ;p2,front,back,left,right
facing =cond(teamside=2,-1,1)
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
supermovetime=99
scale = .5,.5
sprpriority = -6
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0

[State 0, Explod]
type = Explod
triggerall = root,movetype=A
trigger1 = root,stateno=[1000,3500] 
trigger1 =root,time=1
trigger1=var(2)
anim = 8005+(teamside=2)*10
ID = 8002
pos = -10,60+(var(40)*10)
postype = back  ;p2,front,back,left,right
facing =cond(teamside=2,-1,1)
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
supermovetime=99
scale = .5,.5
sprpriority = -6
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
[State 0, VarSet]
type = VarSet
triggerall=var(2)
trigger1 = root,stateno=[1000,3500] 
trigger1 =root,time>1
trigger2=root,stateno!=0&&root,stateno!=[1000,3500] 
v =2   ;fv = 10
value = 0
[State 0, Explod]
type = Explod
triggerall = !numexplod(8001) 
trigger1 = var(1) && ( helper(10003),var(58)=1) 
anim = 8001+(teamside=2)*10
ID = 8001
pos = -10,60+(var(40)*10)
postype = back  ;p2,front,back,left,right
facing =cond(teamside=2,-1,1)
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
supermovetime=99
scale = .5,.5
sprpriority = -6
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 0, VarSet]
type = VarSet
trigger1 =var(1)&& ( helper(10003),var(58)=1) 
v = 1   ;fv = 10
value = 0
[State 0, DisplayToClipboard]
type = DisplayToClipboard
trigger1 = 1
text = "var(10) = %d  vel x = %d %d"
params = var(2),numexplod(8002),numexplod(8001)
ignorehitpause = 1
;persistent = 
;---------------------------------------------------------------------------------------------------
[Statedef 6210]
type    = A
movetype= I
physics = N
juggle  = 8
velset=0,0
poweradd= 0
ctrl = 0
anim =10000
sprpriority = 9

[State 0, BindToRoot]
type = BindToRoot
trigger1 = root,statetype!=A
;trigger1=
pos =-8,-60

[State 0, BindToRoot]
type = BindToRoot
trigger1 =  root,statetype=A
pos =0,-68


[State 0, Explod]
type = Explod
trigger1 = time=0
anim =6200
ID =1001
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime =-1
removetime=7
vel = 0,0
accel = 0,0
random = 0,0
scale = 1.5,1.5
sprpriority = 3
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1

[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = time>0
ID =1001
scale = 1.5-(time*.225),1.5-(time*.225)
;

;
[State 0, Explod]
type = Explod
trigger1 = time=7
anim =6201
ID =1002
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime =-1
vel = 0,0
accel = 0,0
random = 0,0
scale = .5,.5
sprpriority = 3
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1

[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = time>0
ID =1002
scale = .5-((time-7)*.14),.5-((time-7)*.14)
;
[State 0, Explod]
type = Explod
trigger1 = time=10
anim =6201
ID =1003
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime =-1
vel = 0,0
accel = 0,0
random = 0,0
scale = .75,.75
sprpriority = 3
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1

[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = time>10
ID =1003
scale = .75-((time-10)*.205),.75-((time-10)*.205)

[State 0, DestroySelf]
type = DestroySelf
trigger1 = time=13
;---------------------------------------------------------------------------------------------------
[Statedef 6211]
type    = A
movetype= I
physics = N
juggle  = 8
velset=0,0
poweradd= 0
ctrl = 0
anim =10000
sprpriority = 9
[State 0, Explod]
type = Explod
trigger1 = time=0
anim =6202
ID =6202
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime =-1
removetime=36
pausemovetime=99
supermovetime=99
vel = 0,0
accel = 0,0
random = 0,0
scale = .45,.45
sprpriority = 2
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = 1
ID =6202
scale = .45-(0.008*time),.45-(0.008*time)
shadow = 0,0,0
ownpal = 1
removeongethit =1




[State 0, Explod]
type = Explod
trigger1 = time=32
anim =6200
ID =1001
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime =-1
removetime=7
vel = 0,0
accel = 0,0
random = 0,0
scale = .15,.15
pausemovetime=99
supermovetime=99
sprpriority = 3
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1

[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = time>32
ID =1001
scale = .15+((time-32)*.371),.15+((time-32)*.371)

[State 0, Explod]
type = Explod
trigger1 = time=26
anim =6201
ID =1002
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime =-1
removetime=6
vel = 0,0
accel = 0,0
random = 0,0
scale = .225,.225
pausemovetime=99
supermovetime=99
sprpriority = 3
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1

[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = time>26
ID =1002
scale = .5+((time-26)*.14),.5+((time-26)*.14)
;
[State 0, Explod]
type = Explod
trigger1 = time=3
anim =6201
ID =1003
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime =-1
removetime=4
vel = 0,0
accel = 0,0
random = 0,0
scale = 1.5,1.5
pausemovetime=99
supermovetime=99
sprpriority = 3
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1

[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = time>3
ID =1003
scale = 1.5-((time-3)*.415),1.5-((time-3)*.415)

[State 0, DestroySelf]
type = DestroySelf
trigger1 = time=39
;---------------------------------------------------------------------------------------------------
;bgs
[Statedef 6201]
type    = A
movetype= I
physics = N
juggle  = 8
velset=0,0
poweradd= 0
ctrl = 0
anim =10000
sprpriority =0


[State 0, Explod]
type = Explod
trigger1 = time=0
anim = cond(root,stateno=3100,6211,cond(root,stateno>=3500,6212,6210))
ID = 12020
pos = 160,120
postype = back  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
pausemovetime = 99
supermovetime=99
scale = .5,.5
sprpriority = -6
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0

[State 0, Explod]
type = Explod
trigger1 = time%2=0
anim = 6203
ID = 12020
pos = 40,0
postype = back  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 12,0
accel = 0,0
random = 160,120
removetime = 30
pausemovetime = 99
supermovetime=99
scale = .5,.5
sprpriority = 0
ontop = root,stateno!=3501
shadow = 0,0,0
ownpal = 1
removeongethit = 0
[State 0, Explod]
type = Explod
trigger1 = time%2=0
anim = 6203
ID = 12020
pos = 40,200
postype = back  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 12,0
accel = 0,0
random = 160,60
removetime = 30
pausemovetime = 99
supermovetime=99
scale = .5,.5
sprpriority = 0
ontop = root,stateno!=3501
shadow = 0,0,0
ownpal = 1
removeongethit = 0

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = time>=39 && root,stateno!=3501 || root,stateno=3501&&root,animelemtime(118)>=0 && !root,winko
id = 12020
;ignorehitpause = 
;persistent = 

[State 0, DestroySelf]
type = DestroySelf
trigger1 = time>=39&& root,stateno!=3501 ||  root,stateno=3501&&root,animelemtime(118)>=0 && !root,winko
;---------------------------------------------------------------------------------------------------
[Statedef 7000]
type    = A
movetype= I
physics = N
juggle  = 8
velset=0,0
poweradd= 0
ctrl = 0
anim =10000
sprpriority = 9
[State 0, VarSet]
type = VarSet
trigger1 = !root,movehit
v = 0    ;fv = 10
value = root,stateno

[State 0, BindToRoot]
type = BindToRoot
trigger1 = root,movehit && !enemy,hitshakeover
time = 1
facing =1
pos = ceil(root,fvar(20)),ceil(root,fvar(21))
ignorehitpause = 1
;persistent = 

[State 0, Explod]
type = Explod
trigger1 = root,movehit && (root,stateno=var(0) && !numexplod(12000)|| root,stateno!=var(0))
anim = 6500+(root,var(20)*10)
ID = 12000
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
;---------------------------------------------------------------------------------------------------
;finishbg
[Statedef 7001]
type    = A
movetype= I
physics = N
juggle  = 8
velset=0,0
poweradd= 0
ctrl = 0
anim =10000
sprpriority = 9
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 =time<=47
flag = noBG
flag2 = noFG
ignorehitpause=1

[State 0, Explod]
type = Explod
trigger1 = time=0 && root,stateno=[3000,3501]
anim = cond(root,stateno=3100,6211,cond(root,stateno>=3500,6212,6210))
ID = 12020
pos = 160,120
postype = back  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = 47
pausemovetime = 99
supermovetime=99
scale = .5,.5
sprpriority = -6
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 0, BGPalFX]
type = BGPalFX
trigger1 = time>46
time = 1
add = 256,256,256
mul = 256,256,256
sinadd = 0,0,0,10
invertall = 0
color = 256
ignorehitpause = 1
;persistent = 
;
[State 0, Explod]
type = Explod
trigger1 = time=0
anim = 7000
ID = 12000
pos = 160,120
postype = back ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
supermovetime=99
removetime=42
scale =.3,.3
sprpriority = -5
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = time>0
ID =12000
scale =.3+((time)*.0261),.3+((time)*.0261)
[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = time>23
ID =12000
scale =.9+((time-23)*.0161),.9
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = time=46
id = 12020
;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = Varset
trigger1 = time%3=0
v =0    ;fv = 10
value = 0
[State 0, Explod]
type = Explod
trigger1 = time%3=0 && time <44
anim = 6998+(random%2)
ID = 12001
pos = 160,120
postype = back ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
supermovetime=99
scale =.2,.2
sprpriority = -6
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 0, VarSet]
type = Varadd
trigger1 = numexplod(12001)
v =0    ;fv = 10
value = 1
[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = numexplod(12001)
ID =12001
scale =.2+((var(0))*.35),.2+((var(0))*.35)

[State 0, DestroySelf]
type = DestroySelf
trigger1 = time>50&& (enemy,vel y >0 && enemy,pos y >-20||p2stateno=[5100,5150])
;---------------------------------------------------------------------------------------------------
[Statedef 9997]
type    = A
movetype= I
physics = N
juggle  = 0
velset=0,0
poweradd= 0
ctrl = 0
anim =10000
sprpriority = 9
;#region cvs2_buffer_dec.vns
;==============================================================================;
;Command Buffering File for: Alex (Capcom VS. SNK 2)                           ;
;Original system for Capcom VS. SNK: Collision Course                          ;
;by Vans                                                                       ;
;Modifications by Jesuszilla for Capcom VS. SNK 2.                             ;
;==============================================================================;
;Introduction:
;This is the 9-tick / 2-tick based command buffering system. Coded to be Capcom
;compliant following Capcom vs. SNK 2 as a guide.
;
;The helper is capable of providing buffering as well as PERFECT reversedz
;commands in addition to negative edge checking for command var iables.
;
;Any and all editions should be done in the BUFFER DEFINITION section.
;
;Unless you plan to modify the whole system, do not touch the numbers in the
;varsets, ever.
;
;Try to keep a list of the variables used as well as the respective commands,
;just to keep some sort of order.
;
;In addition, try to follow this list as much as possible to avoid problems:
;Basic and system commands   = var(0)  - var(8) (RESERVED.)
;Special move type commands  = var(10) - var(29)
;Multiple button commands    = var(30) - var(39) (RESERVED.)
;Super move type commands    = var(40) - var(49)
;Double-tap                  = var(54) - var(56)
;Free commands               = var(57) - var(59)

[State 10371, NO TURN BEHAVIOR.]
type = AssertSpecial
trigger1 = 1
flag = invisible ;Just in case.
ignorehitpause = 1

[State 10371, BindToRoot]
type = BindToRoot
trigger1 = 1
time = 1
pos = -Const(size.ground.back),Const(size.mid.pos.y)
ignorehitpause = 1

[State 10371, P]
type = null;DisplayToClipboard
trigger1 = 1
text = "X %d  -X = %d | Y = %d  -Y = %d | Z = %d  -Z = %d"
params = var(0),var(7),var(1),var(8),var(2),var(9)
ignorehitpause = 1
[State 10371, K]
type = null;DisplayToClipboard
trigger1 = 1
text = "A %d  -A = %d | B = %d  -B = %d | C = %d  -C = %d"
params = var(3),var(10),var(4),var(11),var(5),var(12)
ignorehitpause = 1

[State 10371, AM I WORKING ?]
type = null;DisplayToClipboard
trigger1 = 1
text = "U = %d  D = %d  F = %d   B = %d\n"
params = var(6),var(7),var(8),var(9)
ignorehitpause = 1
[State 10371, AM I WORKING ?]
type = null;AppendToClipboard
trigger1 = 1
text = "\n             -F = %d  -B = %d Var(51) = %d"
params = var(10),var(11),var(51)
ignorehitpause = 1

[State 10371, AM I WORKING ?]
type = null;AppendToClipboard
trigger1 = 1
text = "DD = %d  FF = %d  BB = %d  POW = %d"
params = var(54),var(55),var(56),var(28)
ignorehitpause = 1

[State 10371, DOES THE DAMN THING WORK]
type = null;AppendToClipboard
trigger1 = 1
text = "K: LM: %d  LH: %d  MH: %d"
params = var(33),var(34),var(35)
ignorehitpause = 1

[State 10371, DOES THE DAMN THING WORK]
type = null;DisplayToClipboard
trigger1 = 1
text = "RLS_DIR = %d, CDBDFDBU: %d, BT = %d, CF,B = %d, Special = %d"
params = var(5), var(41), var(26), var(30), var(59)
ignorehitpause = 1

[State 10371, DOES THE DAMN THING WORK]
type = DisplayToClipboard
trigger1 = 1
text = "CD = %d, SUPUH = %d\nSpecial = %d %d"
params = var(3), var(4), var(5),var(20) ; var(26), var(30), var(59)
ignorehitpause = 1

[State 10371, Custom Combo]
type = VarSet
trigger1 = 1
fvar(30) = root,Var(30)

;----------------------------[BUFFER DECREASE]---------------------------------;
; The button and cardinal direction buffers are special in that they do not use
; normal integer subtraction for each buffer. That is because it would make the
; code ugly and unreadable. Thus, it uses bitwise shifting through division due
; to M.U.G.E.N's lack of bitwise shift operators.
;
; Think of each button and direction as an enumeration flag. When initializing
; (when a button is first pressed), it initializes the most significant bits.
; The buffer decreases by shifting the entire array down to the next size of
; bits. There are 7 buttons, so 7 bits are used. Therefore, up to 4 ticks of
; button buffering can be stored in one var in this architecture. Directions
; only require 4 bits because there are only 4 directions. Therefore, the
; direction arrays can store up to 8 ticks of buffering.
;
; In either case, however, the Capcom vs. SNK 2 buffering system used here only
; uses 2 ticks of buffering.
;
; Suppose a user presses LP and LK at the same time. The basic bit array in this
; structure would look as follows:
;
; 0010001
;
; Going from least significant bit (the rightmost bit) to the most significant
; bit (the leftmost bit), the bits that are filled for LP and LK are the 1st
; and 5th bits, respectively.
;
; So for the buffering system defined in this file, the variable would actually
; look as follows for the first tick. Recall that M.U.G.E.N int variables are
; 32 bits:
;
; 00000000000000000000100010000000
;
; The next tick, this array of 7 bits would be shifted down to the next 7 bits.
; In M.U.G.E.N, this is accomplished by dividing the number by 128. Thus, the
; bits in the variable would look as follows on the second tick:
;
; 00000000000000000000000000010001
;
;
; This algorithm is the same for every variable used for buffering. However,
; each variable used in this system serves a specific purpose:
;
; Var(0) - Used to signify button presses.
; Var(1) - Used to signify button holds.
; Var(2) - Used to signify button releases.
; Var(3) - Used to signify direction presses.
; Var(4) - Used to signify direction holds.
; Var(5) - Used to signify direction releases.
;
; A command for Var(0) or Var(3) is like a raw button, such as x or F. Similarly,
; Var(1) and Var(4) can be used for hold behavior, like /x or /F. Finally, Var(2)
; and Var(5) are used for release behavior, like ~x or ~F. These are all
; necessary in order to overcome M.U.G.E.N's limitations to provide a more solid
; command system.
;
; If you don't understand this explanation, that is OK. CNS may be your first,
; or only, computer language, and this system is built upon years of expertise
; in computer science. You can read up on bitwise operations here. I hope these
; links survive time!
;
; English:
; http://mugenguild.com/forum/topics/bitwise-variables-demystified-137076.0.html
; https://en.wikipedia.org/wiki/Bitwise_operation
;
; 日本語:
; https://ja.wikipedia.org/wiki/%E3%83%93%E3%83%83%E3%83%88%E6%BC%94%E7%AE%97
;
;--------------------------------[BUTTONS]-------------------------------------;
;BUTTON:
;var(0) = PRESS
;var(1) = HOLD
;var(2) = RELEASE
;Final tick (pattern repeats going up, can store 4 ticks):
; LP    = 0x01
; MP    = 0x02
; HP    = 0x04
; Start = 0x08
; LK    = 0x10
; MK    = 0x20
; HK    = 0x40

[State 10371, Hold Dec]
type = VarSet
trigger1 = root, HitPauseTime = 0
var(1) = var(1)/128
ignorehitpause = 1

[State 10371, Press Dec]
type = VarSet
trigger1 = root, HitPauseTime = 0
var(0) = (var(0)/128)
ignorehitpause = 1

[State 10371, Negative Edge Dec]
type = VarSet
trigger1 = root, HitPauseTime = 0
var(2) = var(2)/128
ignorehitpause = 1

;---------------------------------[DIRECTIONS]---------------------------------;
;DIRECTIONAL:
;var(3) = PRESS
;var(4) = HOLD
;var(5) = RELEASE
;Final tick (pattern repeats going up, can store 8 ticks):
; Up      = 0x01
; Down    = 0x02
; Back    = 0x04
; Forward = 0x08

[State 10371, Hold Dec]
type = VarSet
trigger1 = Var(4)
var(4) = var(4)/16
ignorehitpause = 1

[State 10371, Press Dec]
type = VarSet
trigger1 = Var(3)
var(3) = var(4) | (var(3)/16)
ignorehitpause = 1

[State 10371, Negative Edge Dec]
type = VarSet
trigger1 = Var(5)
var(5) = var(5)/16
ignorehitpause = 1

;DIRECTIONAL:
;var(6) = UP
;var(7) = DOWN
;var(8) = FWD
;var(9) = BWD
;var(10) = RELEASE FWD
;var(11) = RELEASE BWD
;var(54) = DD
;var(55) = FF
;var(56) = BB
[State 10371, Neg FWD Dec]
type = VarAdd
trigger1 = Var(6)
var(6) = -1
ignorehitpause = 1
[State 10371, Neg BWD Dec]
type = VarAdd
trigger1 = Var(7)
var(7) = -1
ignorehitpause = 1
[State 10371, Neg DOWN Dec]
type = VarAdd
trigger1 = Var(8)
var(8) = -1
ignorehitpause = 1

[State 10371, FF Dec]
type = VarSet
trigger1 = (var(55)&15)
var(55) = (var(55)^(var(55)&15)) | ((var(55)&15) - 1)
ignorehitpause = 1
[State 10371, BB Dec]
type = VarSet
trigger1 = (var(56)&15)
var(56) = (var(56)^(var(56)&15)) | ((var(56)&15) - 1)
ignorehitpause = 1
;------------------------------[MULTIPLE BUTTONS]------------------------------;
;DOUBLE BUTTON:
;var(30) = LP+MP
;var(31) = LP+HP
;var(32) = MP+LK
;var(33) = LK+MK
;var(34) = LK+HK
;var(35) = MK+LP
;var(36) = LP+LK
;var(37) = MP+MK
;var(38) = HP+HK
[State 10371, LP+MP Dec]
type = VarAdd
triggerall = root, HitPauseTime = 0
trigger1 = var(30)
var(30) = -1
ignorehitpause = 1
[State 10371, LP+HP Dec]
type = VarAdd
triggerall = root, HitPauseTime = 0
trigger1 = var(31)
var(31) = -1
ignorehitpause = 1
[State 10371, MP+HP Dec]
type = VarAdd
triggerall = root, HitPauseTime = 0
trigger1 = var(32)
var(32) = -1
ignorehitpause = 1

[State 10371, LK+MK Dec]
type = VarAdd
triggerall = root, HitPauseTime = 0
trigger1 = var(33)
var(33) = -1
ignorehitpause = 1
[State 10371, LK+HK Dec]
type = VarAdd
triggerall = root, HitPauseTime = 0
trigger1 = var(34)
var(34) = -1
ignorehitpause = 1
[State 10371, MK+HK Dec]
type = VarAdd
triggerall = root, HitPauseTime = 0
trigger1 = var(35)
var(35) = -1
ignorehitpause = 1

[State 10371, LP+LK Dec]
type = VarAdd
triggerall = root, HitPauseTime = 0
trigger1 = var(36)
var(36) = -1
ignorehitpause = 1
[State 10371, MP+MK Dec]
type = VarAdd
triggerall = root, HitPauseTime = 0
trigger1 = var(37)
var(37) = -1
ignorehitpause = 1
[State 10371, HP+HK Dec]
type = VarAdd
triggerall = root, HitPauseTime = 0
trigger1 = var(38)
var(38) = -1
ignorehitpause = 1
;#endregion

;----------------------------------[COMMANDS]----------------------------------;
;var(21)  = QCF
;var(22)  = DP
;var(23)  = QCB
;var(24)  = HCB
;var(25)  = HCF
;var(26)  = CB,F
;var(27)  = CF,B
;var(28)  = CD,U
;var(40)  = QCFx2
;var(41)  = QCBx2

;------------------- SUPERS ---------------------------------------------------;
[State 10371, QCFx2 Dec]
type = VarSet
trigger1 = (var(40)&15)
var(40) = (var(40)^(var(40)&15)) | ((var(40)&15) - 1)
ignorehitpause = 1

[State 10371, QCBx2 Dec]
type = VarSet
trigger1 = (var(41)&15)
var(41) = (var(41)^(var(41)&15)) | ((var(41)&15) - 1)
ignorehitpause = 1

[State 10371, 360 Dec]
type = VarSet
trigger1 = (var(42)&15)
var(42) = (var(42)^(var(42)&15)) | ((var(42)&15) - 1)
ignorehitpause = 1

[State 10371, 360 Dec]
type = VarSet
trigger1 = (var(43)&15)
var(43) = (var(43)^(var(43)&15)) | ((var(43)&15) - 1)
ignorehitpause = 1

[State 10371, 360 Dec]
type = VarSet
trigger1 = (var(44)&15)
var(44) = (var(44)^(var(44)&15)) | ((var(44)&15) - 1)
ignorehitpause = 1

[State 10371, 360 Dec]
type = VarSet
trigger1 = (var(45)&15)
var(45) = (var(45)^(var(45)&15)) | ((var(45)&15) - 1)
ignorehitpause = 1

[State 10371, 360 Dec]
type = VarSet
trigger1 = (var(46)&15)
var(46) = (var(46)^(var(46)&15)) | ((var(46)&15) - 1)
ignorehitpause = 1

[State 10371, 360 Dec]
type = VarSet
trigger1 = (var(47)&15)
var(47) = (var(47)^(var(47)&15)) | ((var(47)&15) - 1)
ignorehitpause = 1

[State 10371, 360 Dec]
type = VarSet
trigger1 = (var(48)&15)
var(48) = (var(48)^(var(48)&15)) | ((var(48)&15) - 1)
ignorehitpause = 1

[State 10371, 360 Dec]
type = VarSet
trigger1 = (var(49)&15)
var(49) = (var(49)^(var(49)&15)) | ((var(49)&15) - 1)
ignorehitpause = 1
[State 10371, 360 Dec]
type = VarSet
trigger1 = (var(57)&15)
var(57) = (var(57)^(var(57)&15)) | ((var(57)&15) - 1)
ignorehitpause = 1
[State 10371, 360 Dec]
type = VarSet
trigger1 = (var(58)&15)
var(58) = (var(58)^(var(58)&15)) | ((var(58)&15) - 1)
ignorehitpause = 1
;------------------- SPECIALS -------------------------------------------------;
[State 10371, DP Dec]
type = VarSet
trigger1 = (var(22)&15)
var(22) = (var(22)^(var(22)&15)) | ((var(22)&15) - 1)
ignorehitpause = 1

[State 10371, rDP Dec]
type = VarSet
trigger1 = (var(23)&15)
var(23) = (var(23)^(var(23)&15)) | ((var(23)&15) - 1)
ignorehitpause = 1

[State 10371, QCF Dec]
type = VarSet
trigger1 = (var(20)&15)
var(20) = (var(20)^(var(20)&15)) | ((var(20)&15) - 1)
ignorehitpause = 1

[State 10371, QCB Dec]
type = VarSet
trigger1 = (var(21)&15)
var(21) = (var(21)^(var(21)&15)) | ((var(21)&15) - 1)
ignorehitpause = 1

[State 10371, HCF Dec]
type = VarSet
trigger1 = (var(24)&15)
var(24) = (var(24)^(var(24)&15)) | ((var(24)&15) - 1)
ignorehitpause = 1

[State 10371, HCB Dec]
type = VarSet
trigger1 = (var(25)&15)
var(25) = (var(25)^(var(25)&15)) | ((var(25)&15) - 1)
ignorehitpause = 1

[State 10371, CB,F Dec]
type = VarSet
trigger1 = (var(26)&15)
var(26) = (var(26)^(var(26)&15)) | ((var(26)&15) - 1)
ignorehitpause = 1

[State 10371, CF,B Dec]
type = VarSet
trigger1 = (var(27)&15)
var(27) = (var(27)^(var(27)&15)) | ((var(27)&15) - 1)
ignorehitpause = 1

[State 10371, FBF Dec]
type = VarSet
trigger1 = (var(28)&15)
var(28) = (var(28)^(var(28)&15)) | ((var(28)&15) - 1)
ignorehitpause = 1
[State 10371, FBF Dec]
type = VarSet
trigger1 = (var(29)&15)
var(29) = (var(29)^(var(29)&15)) | ((var(29)&15) - 1)
ignorehitpause = 1
;#region cvs2_buffer_init.vns
;--------------------------[BUFFER DEFINITION]---------------------------------;
;----------------------------[BUTTON BUFFER]-----------------------------------;
;Leave the BUTTON BUFFER alone for compatibility.
;BUTTON:
;var(0) = PRESS
;var(1) = HOLD
;var(2) = RELEASE
;Final tick (pattern repeats going up, can store 4 ticks):
; 1 - LP
; 2 - MP
; 4 - HP
; 8 - Start
;16 - LK
;32 - MK
;64 - HK
;DIRECTIONAL:
;var(3) = PRESS
;var(4) = HOLD
;var(5) = RELEASE
;Final tick (pattern repeats going up, can store 8 ticks):
; 1 - U
; 2 - D
; 4 - B
; 8 - F

;BUTTON PRESS:

;BUTTON HOLD:
[State 10371, START Init]
type = VarSet
trigger1 = command = "start" || command = "hold_start"
var(1) = var(1)|1024
ignorehitpause = 1

[State 10371, HK Init]
type = VarSet
trigger1 = command = "c" || command = "hold_c"
var(1) = var(1)|8192
ignorehitpause = 1

[State 10371, HP Init]
type = VarSet
trigger1 = command = "z" || command = "hold_z"
var(1) = var(1)|512
ignorehitpause = 1

[State 10371, MK Init]
type = VarSet
trigger1 = command = "b" || command = "hold_b"
var(1) = var(1)|4096
ignorehitpause = 1

[State 10371, MP Init]
type = VarSet
trigger1 = command = "y" || command = "hold_y"
var(1) = var(1)|256
ignorehitpause = 1

[State 10371, LK Init]
type = VarSet
trigger1 = command = "a" || command = "hold_a"
var(1) = var(1)|2048
ignorehitpause = 1

[State 10371, LP Init]
type = VarSet
trigger1 = command = "x" || command = "hold_x"
var(1) = var(1)|128
ignorehitpause = 1

[State 10371, HK Init]
type = VarSet
trigger1 = (var(1)&1024) = 1024 && (var(1)&32) = 0
trigger2 = command="start"&& (var(0)&1024) = 0
var(0) = var(0)|1024
ignorehitpause = 1


[State 10371, HK Init]
type = VarSet
trigger1 = (var(1)&8192) = 8192 && (var(1)&64) = 0
trigger2 = command="c"&& (var(0)&8192) = 0
var(0) = var(0)|8192
ignorehitpause = 1


[State 10371, HP Init]
type = VarSet
trigger1 = (var(1)&512) = 512 && (var(1)&4) = 0
trigger2 = command="z"&& (var(0)&512) = 0
var(0) = var(0)|512
ignorehitpause = 1

[State 10371, MK Init]
type = VarSet
trigger1 = (var(1)&4096) = 4096 && (var(1)&32) = 0
trigger2 = command="b"&& (var(0)&4096) = 0
var(0) = var(0)|4096
ignorehitpause = 1

[State 10371, MP Init]
type = VarSet
trigger1 = (var(1)&256) = 256 && (var(1)&2) = 0
trigger2 = command="y"&& (var(0)&256) = 0
var(0) = var(0)|256
ignorehitpause = 1

[State 10371, LK Init]
type = VarSet
trigger1 = (var(1)&2048) = 2048 && (var(1)&16) = 0
trigger2 = command="a"&& (var(0)&2048) = 0
var(0) = var(0)|2048
ignorehitpause = 1


[State 10371, LP Init]
type = VarSet
trigger1 = (var(1)&128) = 128 && (var(1)&1) = 0
trigger2 = command="x"&& (var(0)&128) = 0
var(0) = var(0)|128
ignorehitpause = 1


;BUTTON RELEASE:
[State 10371, Neg START Init]
type = VarSet
trigger1 = (var(1)&1024) = 0 && (var(1)&8) > 0
var(2) = var(2)|8
ignorehitpause = 1

[State 10371, Neg HK Init]
type = VarSet
trigger1 = (var(1)&8192) = 0 && (var(1)&64) > 0
var(2) = var(2)|64;8192
ignorehitpause = 1

[State 10371, Neg HP Init]
type = VarSet
trigger1 = (var(1)&512) = 0 && (var(1)&4) > 0
var(2) = var(2)|4;512
ignorehitpause = 1

[State 10371, Neg MK Init]
type = VarSet
trigger1 = (var(1)&4096) = 0 && (var(1)&32) > 0
var(2) = var(2)|32;4096
ignorehitpause = 1

[State 10371, Neg MP Init]
type = VarSet
trigger1 = (var(1)&256) = 0 && (var(1)&2) > 0
var(2) = var(2)|2;256
ignorehitpause = 1

[State 10371, Neg LK Init]
type = VarSet
trigger1 = (var(1)&2048) = 0 && (var(1)&16) > 0
var(2) = var(2)|16;2048
ignorehitpause = 1

[State 10371, Neg LP Init]
type = VarSet
trigger1 = (var(1)&128) = 0 && (var(1)&1) > 0
var(2) = var(2)|1;128
ignorehitpause = 1

;DIRECTION PRESS:
[State 10371, UP Init]
type = VarSet
trigger1 = command = "up"
var(3) = var(3)|16
ignorehitpause = 1

[State 10371, DOWN Init]
type = VarSet
trigger1 = command = "down"
var(3) = var(3)|32
ignorehitpause = 1

[State 10371, BWD Init]
type = VarSet
trigger1 = command = "back"
var(3) = var(3)|64
ignorehitpause = 1

[State 10371, FWD Init]
type = VarSet
trigger1 = command = "fwd"
var(3) = var(3)|128
ignorehitpause = 1

;DIRECTION HOLD:
[State 10371, UP Init]
type = VarSet
trigger1 = command = "up" || command = "holdup"
var(4) = var(4)|16
ignorehitpause = 1

[State 10371, DOWN Init]
type = VarSet
trigger1 = command = "down" || command = "holddown"
var(4) = var(4)|32
ignorehitpause = 1

[State 10371, BWD Init]
type = VarSet
trigger1 = command = "back" || command = "holdback"
var(4) = var(4)|64
ignorehitpause = 1

[State 10371, FWD Init]
type = VarSet
trigger1 = command = "fwd" || command = "holdfwd"
var(4) = var(4)|128
ignorehitpause = 1

;DIRECTION RELEASE:
[State 10371, Neg UP Init]
type = VarSet
trigger1 = (var(4)&16) = 0 && (var(4)&1) > 0
var(5) = var(5)|1;16
ignorehitpause = 1

[State 10371, Neg DOWN Init]
type = VarSet
trigger1 = (var(4)&32) = 0 && (var(4)&2) > 0
var(5) = var(5)|2;32
ignorehitpause = 1

[State 10371, Neg BWD Init]
type = VarSet
trigger1 = (var(4)&64) = 0 && (var(4)&4) > 0
var(5) = var(5)|4;64
ignorehitpause = 1

[State 10371, Neg FWD Init]
type = VarSet
trigger1 = (var(4)&128) = 0 && (var(4)&8) > 0
var(5) = var(5)|8;128
ignorehitpause = 1

; TODO
[State 10371, NEG FWD Init]
type = VarSet
triggerall = !Var(6)
trigger1 = p2dist X >= 0
trigger1 = (var(5)&240) = 128 || (var(5)&15) = 8
trigger2 = p2dist X < 0
trigger2 = (var(5)&240) = 64 || (var(5)&15) = 4
var(6) = 10
ignorehitpause = 1
[State 10371, NEG BWD Init]
type = VarSet
triggerall = !Var(7)
trigger1 = p2dist X >= 0
trigger1 = (var(5)&240) = 64 || (var(5)&15) = 4
trigger2 = p2dist X < 0
trigger2 = (var(5)&240) = 128 || (var(5)&15) = 8
var(7) = 10
ignorehitpause = 1
[State 10371, NEG DOWN Init]
type = VarSet
triggerall = !Var(8)
trigger1 = (var(5)&240) = 32 || (var(5)&15) = 2
var(8) = 10
ignorehitpause = 1

;---------------------------[MULTIPLE BUTTON BUFFER]---------------------------;
;DOUBLE BUTTON:
;var(30) = LP+MP
;var(31) = LP+HP
;var(32) = MP+HP
;var(33) = LP+MP
;var(34) = LP+HP
;var(35) = MP+HP
;var(36) = LP+LK
;var(37) = MP+MK
;var(38) = HP+HK

[State 10371, LP+MP init]
type = VarSet
triggerall = !Var(30)
trigger1 = (var(0)&129) > 0 && (var(0)&258) > 0
var(30) = 2
[State 10371, LP+HP init]
type = VarSet
triggerall = !Var(31)
trigger1 = (var(0)&129) > 0 && (var(0)&516) > 0
var(31) = 2
[State 10371, MP+LK init]
type = VarSet
trigger1 = (var(0)&258) > 0 && (var(0)&516) > 0
var(32) = 2

[State 10371, LK+MK init]
type = VarSet
triggerall = !Var(33)
trigger1 = (var(0)&2064) > 0 && (var(0)&4128) > 0
var(33) = 2
[State 10371, LK+HK init]
type = VarSet
triggerall = !Var(34)
trigger1 = (var(0)&2064) > 0 && (var(0)&8256) > 0
var(34) = 2
[State 10371, Install activation init]
type = VarSet
triggerall = !Var(35)
trigger1 = (( var(0)&2064) > 0 && ( var(0)&258) > 0 || (var(0)&129) > 0 && (var(0)&4128))  > 0
var(35) = 2

[State 10371, LP+LK init]
type = VarSet
triggerall = !Var(36)
trigger1 = (var(0)&129) > 0 && (var(0)&2064) > 0
var(36) = 2
[State 10371, MP+MK init]
type = VarSet
triggerall = !Var(37)
trigger1 = (var(0)&258) > 0 && (var(0)&4128) > 0
var(37) = 2
[State 10371, HP+HK init]
type = VarSet
triggerall = !Var(38)
trigger1 = (var(0)&516) > 0 && (var(0)&8256) > 0
var(38) = 2
;#endregion

;----------------------------[COMMAND BUFFER]----------------------------------;
;This is where ONLY THE NECESSARY commands are buffered. The buffer requires
;both the regular command and its reversed equivalent.
;
;ALL COMMANDS SET HERE MUST ALSO BE PUT IN [Commands] UNDER [Buffer Decrease]
;
;One last thing, just like the CMD file, put the complicated commands on top.
;Command checklist:
;
;var(21)         = QCF
;var(22)         = DP
;var(23)         = HCB
;var(28)         = CB,F
;var(29)         = CD,U
;var(40)         = QCFx2
;var(41)         = QCBx2
;var(42)-var(49) = 360

;-----------------[SUPERS]-----------------

[State 10380, QCFHCB Init]
type = Null
trigger1 =((var(44)<=15+ (2**4))||!Var(44))  && ((var(4)&3840) = 512 || (var(4)&240) = 32 || (var(4)&15) = 2)
trigger1 = e||(var(44) := 25 + (2**4))

trigger2 = (Var(44)&(2**5 - 1)) > (2**4) && ((var(3)&3840) = 2048 || (var(3)&240) = 128 || (var(3)&15) = 8)
trigger2 = e||(var(44) := 25 + (2**5))

trigger3 = (Var(44)&(2**6 - 1)) > (2**5) && ((var(3)&3840) = 512 || (var(3)&240) = 32 || (var(3)&15) = 2)
trigger3 = e||(var(44) := 25 + (2**6))

trigger4 = (Var(44)&(2**7 - 1)) > (2**6) && ((var(3)&3840) = 1024 || (var(3)&240) = 64 || (var(3)&15) = 4)
trigger4 = e||(var(44) := 25 + (2**7))

trigger5 = Var(44) && (Var(44)&15) = 0
trigger5 = e||(var(44) := 0)
ignorehitpause = 1

[State 10380, QCBHCF Init]
type = Null
trigger1 = ((var(45)<=15+ (2**4))||!Var(45)) && ((var(4)&3840) = 512 || (var(4)&240) = 32 || (var(4)&15) = 2)
trigger1 = e||(var(45) := 25 + (2**4))

trigger2 = (Var(45)&(2**5 - 1)) > (2**4) && ((var(3)&3840) = 1024 || (var(3)&240) = 64 || (var(3)&15) = 4)
trigger2 = e||(var(45) := 25 + (2**5))

trigger3 = (Var(45)&(2**6 - 1)) > (2**5) && ((var(3)&3840) = 512 || (var(3)&240) = 32 || (var(3)&15) = 2)
trigger3 = e||(var(45) := 25 + (2**6))

trigger4 = (Var(45)&(2**7 - 1)) > (2**6) && ((var(3)&3840) = 2048 || (var(3)&240) = 128 || (var(3)&15) = 8)
trigger4 = e||(var(45) := 25 + (2**7))

trigger5 = Var(45) && (Var(45)&15) = 0
trigger5 = e||(var(45) := 0)
ignorehitpause = 1


[State 10380, FHCF Init]
type = Null
trigger1 = ((var(42)<=15+ (2**4))||!Var(42))  && ((var(5)&3840) = 2048 || (var(5)&240) = 128 || (var(5)&15) = 8)
trigger1 = e||(var(42) := 25 + (2**4))

trigger2 = (Var(42)&(2**5 - 1)) > (2**4) && ((var(3)&3840) = 1024 || (var(3)&240) = 64 || (var(3)&15) = 4)
trigger2 = e||(var(42) := 25 + (2**5))

trigger3 = (Var(42)&(2**6 - 1)) > (2**5) && ((var(3)&3840) = 1536 || (var(3)&240) = 96 || (var(3)&15) = 6)
trigger3 = e||(var(42) := 25 + (2**6))

trigger4 = (Var(42)&(2**7 - 1)) > (2**6) && ((var(3)&3840) = 512 || (var(3)&240) = 32 || (var(3)&15) = 2)
trigger4 = e||(var(42) := 25 + (2**7))

trigger5 = (Var(42)&(2**8 - 1)) > (2**7) && ((var(3)&3840) = 2560 || (var(3)&240) = 160 || (var(3)&15) = 10)
trigger5 = e||(var(42) := 25 + (2**8))

trigger6 = (Var(42)&(2**9 - 1)) > (2**8) && ((var(3)&3840) = 2048 || (var(3)&240) = 128 || (var(3)&15) = 8)
trigger6 = e||(var(42) := 25 + (2**9))

trigger7 = Var(42) && (Var(42)&15) = 0
trigger7 = e||(var(42) := 0)
ignorehitpause = 1


[State 10380, BHCB Init]
type = Null
trigger1 =((var(43)<=15+ (2**4))||!Var(43))  && ((var(5)&3840) = 1024 || (var(5)&240) = 64 || (var(5)&15) = 4)
trigger1 = e||(var(43) := 25 + (2**4))

trigger2 = (Var(43)&(2**5 - 1)) > (2**4) && ((var(3)&3840) = 2048 || (var(3)&240) = 128 || (var(3)&15) = 8)
trigger2 = e||(var(43) := 25 + (2**5))

trigger3 = (Var(43)&(2**6 - 1)) > (2**5) && ((var(3)&3840) = 2560 || (var(3)&240) = 160 || (var(3)&15) = 10)
trigger3 = e||(var(43) := 25 + (2**6))

trigger4 = (Var(43)&(2**7 - 1)) > (2**6) && ((var(3)&3840) = 512 || (var(3)&240) = 32 || (var(3)&15) = 2)
trigger4 = e||(var(43) := 25 + (2**7))

trigger5 = (Var(43)&(2**8 - 1)) > (2**7) && ((var(3)&3840) = 1536 || (var(3)&240) = 96 || (var(3)&15) = 6)
trigger5 = e||(var(43) := 25 + (2**8))

trigger6 = (Var(43)&(2**9 - 1)) > (2**8) && ((var(3)&3840) = 1024 || (var(3)&240) = 64 || (var(3)&15) = 4)
trigger6 = e||(var(43) := 25 + (2**9))

trigger7 = Var(43) && (Var(43)&15) = 0
trigger7 = e||(var(43) := 0)
ignorehitpause = 1

[State 10371, QCFx2 Init]
type = Null
trigger1 =((var(40)<=15+ (2**4))||!Var(40))  && ((var(4)&3840) = 512 || (var(4)&240) = 32 || (var(4)&15) = 2)
trigger1 = e||(var(40) := 15 + (2**4))

trigger2 = (Var(40)&(2**5 - 1)) > (2**4) && ((var(3)&3840) = 2560 || (var(3)&240) = 160 || (var(3)&15) = 10)
trigger2 = e||(var(40) := 15 + (2**5))

trigger3 = (Var(40)&(2**6 - 1)) > (2**5) && ((var(3)&3840) = 2048 || (var(3)&240) = 128 || (var(3)&15) = 8)
trigger3 = e||(var(40) := 15 + (2**6))

trigger4 = (Var(40)&(2**7 - 1)) > (2**6) && ((var(3)&3840) = 512 || (var(3)&240) = 32 || (var(3)&15) = 2)
trigger4 = e||(var(40) := 15 + (2**7))

trigger5 = (Var(40)&(2**8 - 1)) > (2**7) && ((var(3)&3840) = 2560 || (var(3)&240) = 160 || (var(3)&15) = 10)
trigger5 = e||(var(40) := 15 + (2**8))

trigger6 = (Var(40)&(2**9 - 1)) > (2**8) && ((var(3)&3840) = 2048 || (var(3)&240) = 128 || (var(3)&15) = 8)
trigger6 = e||(var(40) := 15 + (2**9))

trigger7 = Var(40) && (Var(40)&15) = 0
trigger7 = e||(var(40) := 0)
ignorehitpause = 1


[State 10371, QCBx2 Init]
type = Null
trigger1 = ((var(41)<=15+ (2**4))||!Var(41))  && ((var(4)&3840) = 512 || (var(4)&240) = 32 || (var(4)&15) = 2)
trigger1 = e||(var(41) := 15 + (2**4))

trigger2 = (Var(41)&(2**5 - 1)) > (2**4) && ((var(3)&3840) = 1536 || (var(3)&240) = 96 || (var(3)&15) = 6)
trigger2 = e||(var(41) := 15 + (2**5))

trigger3 = (Var(41)&(2**6 - 1)) > (2**5) && ((var(3)&3840) = 1024 || (var(3)&240) = 64 || (var(3)&15) = 4)
trigger3 = e||(var(41) := 15 + (2**6))

trigger4 = (Var(41)&(2**7 - 1)) > (2**6) && ((var(3)&3840) = 512 || (var(3)&240) = 32 || (var(3)&15) = 2)
trigger4 = e||(var(41) := 15 + (2**7))

trigger5 = (Var(41)&(2**8 - 1)) > (2**7) && ((var(3)&3840) = 1536 || (var(3)&240) = 96 || (var(3)&15) = 6)
trigger5 = e||(var(41) := 15 + (2**8))

trigger6 = (Var(41)&(2**9 - 1)) > (2**8) && ((var(3)&3840) = 1024 || (var(3)&240) = 64 || (var(3)&15) = 4)
trigger6 = e||(var(41) := 15 + (2**9))

trigger7 = Var(41) && (Var(41)&15) = 0
trigger7 = e||(var(41) := 0)
ignorehitpause = 1


;----------------[SPECIALS]----------------
[State 10380, CB,F Init]
type = Null
trigger1 = !Var(26) && cond(FVar(30), (var(5)&68) > 0, ((Var(10)&511) = [1,9])) ; If in custom combo, use normal release
trigger1 = e||(var(26) := 9 + (2**4))

trigger2 = (Var(26)&(2**5 - 1)) > (2**4) && (var(3)&136) > 0
trigger2 = e||(var(26) := 9 + (2**5))

trigger3 = Var(26) && (Var(26)&15) = 0
trigger3 = e||(var(26) := 0)
ignorehitpause = 1

[State 10380, CF,B Init]
type = Null
trigger1 = !Var(27) && cond(FVar(30), (var(5)&136) > 0, ((Var(10)&511) = [1,9])) ; If in custom combo, use normal release
trigger1 = e||(var(27) := 9 + (2**4))

trigger2 = (Var(27)&(2**5 - 1)) > (2**4) && (var(3)&68) > 0
trigger2 = e||(var(27) := 9 + (2**5))

trigger3 = Var(27) && (Var(27)&15) = 0
trigger3 = e||(var(27) := 0)
ignorehitpause = 1

[State 10380, BFB Init]
type = Null
trigger1 = ((var(28)<=15+ (2**4))||!Var(28))  && ((var(4)&3840) = 1024 || (var(4)&240) = 64 || (var(4)&15) = 4)
trigger1 = e||(var(28) := 15 + (2**4))

trigger2 = (Var(28)&(2**5 - 1)) > (2**4) && ((var(3)&3840) = 2048 || (var(3)&240) = 128 || (var(3)&15) = 8)
trigger2 = e||(var(28) := 15 + (2**5))

trigger3 = (Var(28)&(2**6 - 1)) > (2**5) && ((var(3)&3840) = 1024 || (var(3)&240) = 64 || (var(3)&15) = 4)
trigger3 = e||(var(28) := 15 + (2**6))

trigger4 = Var(28) && (Var(28)&15) = 0
trigger4 = e||(var(28) := 0)
ignorehitpause = 1

[State 10380, FBF Init]
type = Null
trigger1 = ((var(29)<=15+ (2**4))||!Var(29))  && ((var(4)&3840) = 2048 || (var(4)&240) = 128 || (var(4)&15) = 8)
trigger1 = e||(var(29) := 15 + (2**4))

trigger2 = (Var(29)&(2**5 - 1)) > (2**4) && ((var(3)&3840) = 1024 || (var(3)&240) = 64 || (var(3)&15) = 4)
trigger2 = e||(var(29) := 15 + (2**5))

trigger3 = (Var(29)&(2**6 - 1)) > (2**5) && ((var(3)&3840) = 2048 || (var(3)&240) = 128 || (var(3)&15) = 8)
trigger3 = e||(var(29) := 15 + (2**6))

trigger4 = Var(29) && (Var(29)&15) = 0
trigger4 = e||(var(29) := 0)
ignorehitpause = 1



[State 10380, Charge Back]
type = VarAdd
triggerall = var(10) = (255,255+48] ; 48 ticks
trigger1 = p2dist X >= 0
trigger1 = (var(4)&68) > 0          ; holdback
trigger2 = p2dist X < 0
trigger2 = (var(4)&136) > 0         ; holdfwd
var(10) = -1
[State 10380, Charge Down]
type = VarAdd
triggerall = var(11) = (255,255+48] ; 48 ticks
trigger1 = (var(4)&34) > 0          ; holddown
var(11) = -1

[State 10371, Charge Back Dec]
type = VarSet
triggerall = (var(10)&511) = [1,9]
trigger1 = (var(10)&15)
var(10) = (var(10)^(var(10)&15)) | ((var(10)&15) - 1)
[State 10371, Charge Down Dec]
type = VarSet
triggerall = (var(11)&511) = [1,9]
trigger1 = (var(11)&15)
var(11) = (var(11)^(var(11)&15)) | ((var(11)&15) - 1)

[State 10380, Charge Back Buffer]
type = VarSet
triggerall = var(10) = 255
trigger1 = p2dist X >= 0
trigger1 = (var(5)&68) > 0          ; releaseback
trigger2 = p2dist X < 0
trigger2 = (var(5)&136) > 0         ; releasefwd
var(10) = 9
[State 10380, Charge Down Buffer]
type = VarSet
trigger1 = var(11) = 255
trigger1 = (var(5)&34)              ; releasedown
var(11) = 9

[State 10380, Charge Back Reset]
type = VarSet
trigger1 = var(10) = 255    ; Buffer ended or buffer didn't start
trigger1 = p2dist X >= 0
trigger1 = (var(5)&68) > 0
trigger2 = var(10) = 255    ; Buffer ended or buffer didn't start
trigger2 = p2dist X < 0
trigger2 = (var(5)&136) > 0
trigger3 = var(10) = 0      ; INIT
var(10) = 255+48
[State 10380, Charge Down Reset]
type = VarSet
trigger1 = var(11) = 255    ; Buffer ended or buffer didn't start
trigger1 = (var(5)&34)
trigger2 = var(11) = 0      ; INIT
var(11) = 255+48

[State 10371, HCB Init]
type = Null
trigger1 =((var(25)<=15+ (2**4))||!Var(25)) && ((var(4)&3840) = 2048 || (var(4)&240) = 128 || (var(4)&15) = 8)
trigger1 = e||(var(25) := 15 + (2**4))

trigger2 = (Var(25)&(2**5 - 1)) > (2**4) && ((var(3)&3840) = 512 || (var(3)&240) = 32 || (var(3)&15) = 2)
trigger2 = e||(var(25) := 15 + (2**5))

trigger3 = (Var(25)&(2**6 - 1)) > (2**5) && ((var(3)&3840) = 1024 || (var(3)&240) = 64 || (var(3)&15) = 4)
trigger3 = e||(var(25) := 15 + (2**6))

trigger4 = Var(25) && (Var(25)&15) = 0
trigger4 = e||(var(25) := 0)
ignorehitpause = 1



[State 10371, HCF Init]
type = Null
trigger1 = ((var(24)<=15+ (2**4))||!Var(24)) && ((var(4)&3840) = 1024 || (var(4)&240) = 64 || (var(4)&15) = 4)
trigger1 = e||(var(24) := 15 + (2**4))

trigger2 = (Var(24)&(2**5 - 1)) > (2**4) && ((var(3)&3840) = 512 || (var(3)&240) = 32 || (var(3)&15) = 2)
trigger2 = e||(var(24) := 15 + (2**5))

trigger3 = (Var(24)&(2**6 - 1)) > (2**5) && ((var(3)&3840) = 2048 || (var(3)&240) = 128 || (var(3)&15) = 8)
trigger3 = e||(var(24) := 15 + (2**6))

trigger4 = Var(24) && (Var(24)&15) = 0
trigger4 = e||(var(24) := 0)
ignorehitpause = 1
[State 10371, rDP Init]
type = Null
trigger1 = ((var(23)<=15+ (2**4))||!Var(23)) && ((var(4)&3840) = 1024 || (var(4)&240) = 64 || (var(4)&15) = 4)
trigger1 = e||(var(23) := 15 + (2**4))

trigger2 = (Var(23)&(2**5 - 1)) > (2**4) && ((var(3)&3840) = 512 || (var(3)&240) = 32 || (var(3)&15) = 2)
trigger2 = e||(var(23) := 15 + (2**5))

trigger3 = (Var(23)&(2**6 - 1)) > (2**5) && ((var(3)&3840) = 1536 || (var(3)&240) = 96 || (var(3)&15) = 6)
trigger3 = e||(var(23) := 15 + (2**6))

trigger4 = Var(23) && (Var(23)&15) = 0
trigger4 = e||(var(23) := 0)
ignorehitpause = 1
[State 10371, DP Init]
type = Null
trigger1 = ((var(22)<=15+ (2**4))||!Var(22))  && ((var(4)&3840) = 2048 || (var(4)&240) = 128 || (var(4)&15) = 8)
trigger1 = e||(var(22) := 15 + (2**4))

trigger2 = (Var(22)&(2**5 - 1)) > (2**4) && ((var(3)&3840) = 512 || (var(3)&240) = 32 || (var(3)&15) = 2)
trigger2 = e||(var(22) := 15 + (2**5))

trigger3 = (Var(22)&(2**6 - 1)) > (2**5) && ((var(3)&3840) = 2560 || (var(3)&240) = 160 || (var(3)&15) = 10)
trigger3 = e||(var(22) := 15 + (2**6))

trigger4 = Var(22) && (Var(22)&15) = 0
trigger4 = e||(var(22) := 0)
ignorehitpause = 1

[State 10380, QCB Init]
type = Null
trigger1 = ((var(21)<=13+ (2**4))||!Var(21))&& ((var(4)&240) = 32 || (var(4)&15) = 2)
trigger1 = e||(var(21) := 15 + (2**4))

trigger2 = (Var(21)&(2**5 - 1)) > (2**4) && ((var(3)&240) = 96 || (var(3)&15) = 6)
trigger2 = e||(var(21) := 15+ (2**5))

trigger3 = (Var(21)&(2**6 - 1)) > (2**5) && ((var(3)&240) = 64 || (var(3)&15) = 4)
trigger3 = e||(var(21) := 15 + (2**6))

trigger4 = Var(21) && (Var(21)&15) = 0
trigger4 = e||(var(21) := 0)
ignorehitpause = 1

[State 10380, QCF Init]
type = Null
trigger1 = ((var(20)<=15+ (2**4))||!Var(20)) && ((var(4)&3840) = 512 || (var(4)&240) = 32 || (var(4)&15) = 2)
trigger1 = e||(var(20) := 15 + (2**4))

trigger2 = (Var(20)&(2**5 - 1)) > (2**4) && ((var(3)&3840) = 2560 || (var(3)&240) = 160 || (var(3)&15) = 10)
trigger2 = e||(var(20) := 15 + (2**5))

trigger3 = (Var(20)&(2**6 - 1)) > (2**5) && ((var(3)&3840) = 2048 || (var(3)&240) = 128 || (var(3)&15) = 8)
trigger3 = e||(var(20) := 15 + (2**6))

trigger4 = Var(20) && (Var(20)&15) = 0
trigger4 = e||(var(20) := 0)
ignorehitpause = 1

;---------------------------[COMMAND BUFFER ACTIVE]----------------------------;
; This is a single variable for two bits for each command: regular and reversed.
; These should be built upon all previous commands.
;
; Order doesn't really matter since the CMD's going to pick it all up in the
; same tick.
;
; Stores up to 32 commands. If you have even that many unique commands, either
; you're making MvC3 Dante or doing something completely wrong.
;
; I'm doing this for cleanliness, but if you're making a SF2 character, this is
; pretty much required.
;
[State 10380, Command Active]
type = Null
trigger1 = e||(var(59) := 0) ; INIT
trigger1 = e||(var(59) := (var(59)|((2**cond(P2Dist X < 0,  1,  0))*((Var(20)&(2**7  - 1)) > (2**6))))) ; QCF
trigger1 = e||(var(59) := (var(59)|((2**cond(P2Dist X < 0, 0, 1))*((Var(21)&(2**7  - 1)) > (2**6))))) ; QCB
trigger1 = e||(var(59) := (var(59)|((2**cond(P2Dist X < 0,  3,  2))*((Var(22)&(2**7  - 1)) > (2**6))))) ; DP
trigger1 = e||(var(59) := (var(59)|((2**cond(P2Dist X < 0,  2,  3))*((Var(23)&(2**7  - 1)) > (2**6))))) ; rDP
trigger1 = e||(var(59) := (var(59)|((2**cond(P2Dist X < 0,  5,  4))*(( Var(24)&(2**7 - 1)) > (2**6))))) ; HCF
trigger1 = e||(var(59) := (var(59)|((2**cond(P2Dist X < 0,  4,  5))*(( Var(25)&(2**7 - 1)) > (2**6))))) ; HCB
trigger1 = e||(var(59) := (var(59)|((2**cond(P2Dist X < 0,  7,  6))*((Var(26)&(2**6  - 1)) > (2**5))))) ; CB,F
trigger1 = e||(var(59) := (var(59)|((2**cond(P2Dist X < 0,  6,  7))*((Var(27)&(2**6  - 1)) > (2**5))))) ; CF,B
trigger1 = e||(var(59) := (var(59)|((2**cond(P2Dist X < 0,  9,  8))*((Var(28)&(2**7  - 1)) > (2**6))))) ; BFB
trigger1 = e||(var(59) := (var(59)|((2**cond(P2Dist X < 0,  8,  9))*((Var(29)&(2**7  - 1)) > (2**6))))) ; FBF
trigger1 = e||(var(59) := (var(59)|((2**cond(P2Dist X < 0,  11, 10))*((Var(42)&(2**10 - 1)) > (2**9)))))            ; F,HCF
trigger1 = e||(var(59) := (var(59)|((2**cond(P2Dist X < 0,  10, 11))*((Var(43)&(2**10 - 1)) > (2**9)))))             ; B,HCB
trigger1 = e||(var(59) := (var(59)|((2**cond(P2Dist X < 0, 13,  12))*((Var(40)&(2**10 - 1)) > (2**9))))) ; QCFx2
trigger1 = e||(var(59) := (var(59)|((2**cond(P2Dist X < 0,  12, 13))*((Var(41)&(2**10 - 1)) > (2**9))))) ; QCBx2
trigger1 = e||(var(59) := (var(59)|((2**cond(P2Dist X < 0,  15, 14))*(( Var(44)&(2**8 - 1)) > (2**7)))))            ; QCF,HCB
trigger1 = e||(var(59) := (var(59)|((2**cond(P2Dist X < 0,  14, 15))*((Var(45)&(2**8 - 1)) > (2**7)))))           ; QCB,HCF
trigger1 = e||(var(59) := (var(59)|((2**cond(P2Dist X < 0,  17, 16))*(( Var(57)&(2**6 - 1)) > (2**5)))))                        ; DUF
trigger1 = e||(var(59) := (var(59)|((2**cond(P2Dist X < 0,  16, 17))*(( Var(58)&(2**6 - 1)) > (2**5)))))                        ; DUB
trigger1 = e||(var(59) := (var(59)|((2**11)*((Var(48)&(2**8  - 1)) > (2**7)))))                         ; 360
trigger1 = e||(var(59) := (var(59)|((2**11)*((Var(49)&(2**8  - 1)) > (2**7)))))                         ; 360
trigger1 = e||(var(59) := (var(59)|(cond(P2Dist X < 0, -2147483648, 2**30)*((Var(55)&(2**6  - 1)) > (2**5))))) ; FF
trigger1 = e||(var(59) := (var(59)|(cond(P2Dist X < 0, 2**30, -2147483648)*((Var(56)&(2**6  - 1)) > (2**5))))) ; BB
ignorehitpause = 1

;-----------------------------[DIRECTIONAL BUFFER]-----------------------------;
[State 10371, No dash]
type = VarRangeSet
trigger1 = root, Var(13)    ; Parry
trigger2 = root, Var(1) > 0 ; Just Defend
trigger3 = Var(51) > 7      ; Held for 8 ticks or more
value = 0
first = 55
last = 56

[State 10371, Reset X direction]
type = VarRangeSet
triggerall = Var(50) < 1
trigger1 = root, P2Dist X < 0
value = 0
first = 6
last = 7

[State 0, Trigger Once]
type = VarAdd
trigger1 = root, P2Dist X < 0
var(50) = 1
[State 0, Trigger Once]
type = VarSet
trigger1 = root, P2Dist X >= 0
var(50) = 0

[State 10371, F/B Timer] ; Because fuck you, that's why
type = VarSet
trigger1 = var(51) <= 0
trigger2 = (var(4)&204) = 0
var(51) = 0
[State 10371, Timer Inc]
type = VarAdd
trigger1 = (var(4)&192) > 0 && var(51) < 9
var(51) = ifElse((var(4)&192) > 0, 1, -1)

[State 10371, DOWN Timer]
type = VarSet
trigger1 = (var(4)&34) = 0
var(52) = 0
[State 10371, Timer Inc]
type = VarAdd
trigger1 = Var(52)
trigger1 = (var(4)&34) > 0
var(52) = 1

[State 10371, FF Init]
type = Null
trigger1 = !Var(55) && (var(5)&15) = 8 && var(51) < 8
trigger1 = e||(var(55) := 9 + (2**4))

trigger2 = (Var(55)&(2**5 - 1)) > (2**4) && (var(3)&240) = 128
trigger2 = e||(var(55) := 6 + (2**5))

trigger3 = Var(55) && ((Var(55)&15) = 0 || (var(4)&204) > 0)
trigger3 = e||(var(55) := 0)
[State 10371, BB Init]
type = Null
trigger1 = !Var(56) && (var(5)&15) = 4 && var(51) < 8
trigger1 = e||(var(56) := 9 + (2**4))

trigger2 = (Var(56)&(2**5 - 1)) > (2**4) && (var(3)&240) = 64
trigger2 = e||(var(56) := 6 + (2**5))

trigger3 = Var(56) && ((Var(56)&15) = 0 || (var(4)&204) > 0)
trigger3 = e||(var(56) := 0)

[State 10380, LJF Init]
type = Null
trigger1 = !Var(57)  && (((var(5)&61440) = 8192 || (var(5)&3840) = 512 || (var(5)&240) = 32 || (var(5)&15) = 2)||  ((var(5)&3840) = 2560 || (var(5)&240) = 160 || (var(5)&15) = 10)||  ((var(5)&3840) = 2560 || (var(5)&240) = 160 || (var(5)&15) = 10))
trigger1 = e||(var(57) := 12 + (2**4))

trigger2 = (Var(57)&(2**5 - 1)) > (2**4) && ((var(3)&3840) = 2304 || (var(3)&240) = 144 || (var(3)&15) = 9)
trigger2 = e||(var(57) := 11 + (2**5))

trigger3 = Var(57) && (Var(57)&15) = 0
trigger3 = e||(var(57) := 0)
ignorehitpause = 1
[State 10380, LJB Init]
type = Null
trigger1 = !Var(58)  && (((var(5)&61440) = 8192 || (var(5)&3840) = 512 || (var(5)&240) = 32 || (var(5)&15) = 2)||  ((var(5)&3840) = 2560 || (var(5)&240) = 160 || (var(5)&15) = 10)||  ((var(5)&3840) = 2560 || (var(5)&240) = 160 || (var(5)&15) = 10))
trigger1 = e||(var(58) := 12 + (2**4))

trigger2 = (Var(58)&(2**5 - 1)) > (2**4) && ((var(3)&3840) = 1280 || (var(3)&240) = 80 || (var(3)&15) = 5)
trigger2 = e||(var(58) := 12 + (2**5))

trigger3 = Var(58) && (Var(58)&15) = 0
trigger3 = e||(var(58) := 0)
ignorehitpause = 1
;---------------------------------------------------------------------------------------------------
[Statedef 9998]
type    = A
movetype= I
physics = N
juggle  = 8
velset=0,0
poweradd= 0
ctrl = 0
anim =10000
sprpriority = 9
[State 0, DisplayToClipboard]
type = DisplayToClipboard
trigger1 = 1
text = "var(2) = %d var(3) = %d  vel x = %d movehit= %d\nspAIder by Kamekaze"
params = var(0),var(5),var(34),(root,movecontact)
ignorehitpause = 1
;ignorehitpause = 
;persistent = 
;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = VarSet
trigger1 = !var(35)
v = 22   
value = root,var(7)
;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = VarSet
trigger1 = var(30) &&(root,stateno=40||root,stateno=40000||root,movetype=H)
v =30    ;fv = 10
value = 0


;var(35) = movehit
[State 0, VarSet]
type = VarSet
triggerall = var(35)=0
trigger1 = (root,movehit=1||helper(10003),sysvar(2)>5&&root,movehit)&& enemy,hitshakeover
;define exceptions where movecontact is fine
v = 35    
value = 1
[State 0, VarSet]
type = parentVarSet
trigger1 = 1;&& enemy,hitshakeover
v = 45    
value = var(34)
[State 0, VarSet]
type = parentVarSet
trigger1 = 1
v = 46   
value = var(35)
;===non attacks
;incoming
[State 0, VarSet]
type = VarSet
trigger1 =  p2movetype!=H
v = 2    ;fv = 10
value = -1


;====

;==Helpers==
;1002
;[State 0, Null]
;type = Null
;trigger1 =root,numhelper(1002)
;trigger1 = enemy(helper(19999),var(20)),movetype=H&& (random%5>1) &&var(34)=-1
;trigger1 = var(34):=cond(root,p2bodydist x <60,1010,cond(root,var(10)>3,1005,55))
;trigger1 = var(30):=var(34)=55
;trigger2 =root,numhelper(1002) && var(10)<2 && root,p2bodydist x >99
;trigger2 =  helper(1002),vel x =0 && helper(1002),vel y =0
;trigger2 = var(22)&& (random%5>1) 
;trigger2 = var(34):=1003
;trigger2 = var(30):=var(34)=1003
;trigger3 =root,numhelper(1003)&&var(34)=-1
;trigger3 = var(22)&& (random%5>2) 
;trigger3 = var(34):=cond(root,p2bodydist x <60,1010,cond(root,var(10)>3,1005,605))
;trigger3 = var(30):=var(34)=[600,1005]
;trigger4 =root,numhelper(1003) && var(10)<2
;trigger4 = var(22)&& (random%5>1) && helper(1003),vel x =0 && helper(1003),vel y =0&& root,p2bodydist x >100
;trigger4 = var(34):=1003
;trigger4 = var(30):=var(34)=1003
;trigger5 =root,numhelper(1001) && root,stateno=1000 
;trigger5 = root,p2bodydist x <60 && root,frontedgebodydist <45&& enemy,backedgebodydist <20
;trigger5 = helper(1001),movehit && (random%5>2) && root,stateno=1000 
;trigger5 = root,power >400 && enemy(helper(19999),var(20)),statetype=A
;trigger5 = var(34):=4


;====


;====normals

;200
;[State 0, Null]
;type = Null
;triggerall =root,stateno=200&& var(35) 
;trigger1 = power>1000 && root,p2bodydist x >35
;trigger1 = var(34):=cond(root,p2bodydist x >40,1000,1220)
;trigger2 =root,p2bodydist x <35
;trigger2 = var(34):=430
;
;;210
[State 0, Null]
type = Null
triggerall =root,stateno=210&& var(35) && var(34)=-1
trigger1 = root,var(4)&&root,numexplod(1050)=1&&root,numexplod(1051)=1
trigger1 = (1||var(2):=cond(enemy,backedgebodydist>50,1,0))
trigger1 = var(34):=cond(enemy,backedgebodydist>50,1200,1000)
trigger2 = root,var(4)
trigger2 = (1||var(2):=cond(root,p2bodydist x >40,1,cond(root,numexplod(1050)=0,0,1)))
trigger2 = var(34):=cond(root,p2bodydist x >40,1100,1050)

;
;;221
;[State 0, Null]
;type = Null
;triggerall =root,stateno=221&& var(35) 
;trigger1 = power>1000 
;trigger1 = var(34):=cond(root,p2bodydist x >40,1000,1220)
;
;;240
[State 0, Null]
type = Null
triggerall =root,stateno=240&& var(35) && var(34)=-1
trigger1 = root,var(4)&&root,numexplod(1050)=0&&root,numexplod(1051)=0&&p2statetype=A
trigger1 = (1||var(2):=cond(enemy,backedgebodydist>50,1,0))
trigger1 = var(34):=cond(enemy,backedgebodydist>50,1200,1000)
trigger2 = root,var(4)
trigger2 = (1||var(2):=cond(root,p2bodydist x >40,1,cond(root,numexplod(1050)=0,0,1)))
trigger2 = var(34):=cond(root,p2bodydist x >40,1100,1050)

;
;;400
[State 0, Null]
type = Null
triggerall =root,stateno=400&& var(35) && var(34)=-1
trigger1 = p2statetype=A && helper(10003),var(58)<4&&random%2
trigger1 = var(34):=400
trigger2 =p2statetype=A && root,p2bodydist x <65
trigger2 = var(34):=210
;
;;410
[State 0, Null]
type = Null
triggerall =root,stateno=410&& var(35) && var(34)=-1
trigger1 = root,var(4)&&root,numexplod(1050)=0&&root,numexplod(1051)=0
trigger1 = (1||var(2):=cond(enemy,backedgebodydist>50,1,0))
trigger1 = var(34):=cond(enemy,backedgebodydist>50,1200,1000)
trigger2 = root,var(4)
trigger2 = (1||var(2):=cond(root,p2bodydist x >40,1,cond(root,numexplod(1050)=0,0,1)))
trigger2 = var(34):=cond(root,p2bodydist x >40,1100,1050)

;
;;430
;[State 0, Null]
;type = Null
;triggerall =root,stateno=430&& var(35) 
;trigger1 = power>1000 
;trigger1 = var(34):=cond(root,p2bodydist x >40,1000,1220)
;
;;440
;[State 0, Null]
;type = Null
;triggerall =root,stateno=440&& var(35) 
;trigger1 = power>1000 
;trigger1 = var(34):=cond(root,p2bodydist x >40,1000,1220)
[State 0, Null]
type = Null
triggerall =root,stateno=710&& root,movehit&& var(34)=-1 
trigger1 = root,statetype!=A
trigger1 = var(30):=1
trigger1 = var(34):=640
trigger2 = root,statetype=A
trigger2 = var(30):=1
trigger2 = var(34):=630

;specials
;1000
[State 0, Null]
type = Null
triggerall =root,stateno=1000&& var(35) && var(34)=-1
trigger1 = root,var(4)&&!root,var(2)&&(enemy,backedgebodydist >40||cond(numhelper(6100),helper(6100),var(0)<100,0))&& p2statetype=A&&power>1000
trigger1 = var(34):=3000
trigger2 = root,var(4)&&!root,var(2)&&enemy,backedgebodydist <40&& p2statetype=A
trigger2 = var(34):=400
trigger3 = root,backedgebodydist <65 && (p2statetype=A || root,var(2))
trigger3= var(2):=1
trigger3 = var(34):=1100



;1050
[State 0, Null]
type = Null
triggerall =root,stateno=1050&& var(35) && var(34)=-1
trigger1 = root,var(4)&&!root,var(2)&&enemy,backedgebodydist <50&& root,numexplod(1050)=0
trigger1 = var(34):=410
trigger2 = root,var(4)&&!root,var(2)&&(enemy,backedgebodydist >=50||root,numexplod(1050)>0) && root,numexplod(1051)=0
trigger2= (1||var(2):=1)
trigger2 = var(34):=1050

trigger3 = root,var(4)&&root,var(2)
trigger3 = var(34):=410
trigger4 = (root,var(0))&&enemy,pos y<-40 && root,fvar(15)<60
trigger4 = var(34):=400

;1100
[State 0, Null]
type = Null
triggerall =root,stateno=1100&&root,var(2)&&(root,var(0)||p2statetype!=A)&& var(35) && var(34)=-1
trigger1 = random%4=1 && power>1000 && root,var(59)>=10000
trigger1 = var(34):=4000
trigger2 = random%2
trigger2=(1||var(2):=0)
trigger2 = var(34):=1200

trigger3 = var(34):=400

;supers
;4000
[State 0, Null]
type = Null
triggerall =root,stateno=4000&& !var(35) 
trigger1 = random%2 && (helper(10003),var(10)|| p2movetype=A && root,p2bodydist x <30)
trigger1 = var(34):=430
trigger2 = random%2 && helper(10003),var(11)
trigger2 = var(34):=210
trigger3 = random%4<3 && p2movetype=A && fvar(15)<50
trigger3 = var(34):=1050
trigger4 = random%4=3 && enemy,hitfall&& fvar(15)<60
trigger4 = var(34):=210
trigger5 = random%4<3 && enemy,hitfall&& fvar(15)<50
trigger5 = var(34):=400
;=====================

[State 0, VarSet]
type = VarSet
trigger1 = var(4)!=0 && root,ctrl
v = 4    
value = 0
;ignorehitpause = 
;persistent = 


[State 0, VarSet]
type = parentVarSet
trigger1 = p2movetype=H || root,var(4) && root,movetype!=H
v = 45   
value = var(34)
;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = VarSet
trigger1 = p2movetype!=H && p2movetype!=A || root,movetype=H
trigger2 = root,stateno=var(34)&& root,time=1
v = 34    
value = -1

[State 0, VarSet]
type = VarSet
trigger1 = var(35)
v = 35    
value = 0
;selection made?

;ignorehitpause = 
;persistent = 

; [State 0, DestroySelf]
;type = DestroySelf
;trigger1 =roundstate!=2
;---------------------------------------------------------------------------------------------------
[Statedef 9999]
type    = A
movetype= I
physics = N
juggle  = 8
velset=0,0
poweradd= 0
ctrl = 0
anim =10000
sprpriority = 9

;[State 0, PowerAdd]
;type = PowerAdd
;triggerall = root,movetype!=A
;trigger1 = gametime%80=0 &&  root,power<1000
;value = -20
;[State 0, VarSet]
;type = parentVarSet
;trigger1 =root,movetype=I 
;v = 1    
;value = 0

;[State 0, VarSet]
;type = parentVarSet
;trigger1 =root,movetype=I 
;v =2    
;value = 0
;---customstatesnd
[State 0, Helper]
type = Helper
trigger1 = root,winko
helpertype = normal ;player
name ="finish"
ID = 7001
stateno = 7001
pos =-8,-60
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
size.xscale=1
size.yscale=1
persistent=0
supermovetime=99
pausemovetime=99
;---gethits
[State -3, Hit0]
type = PlaySnd
triggerall = Alive
triggerall = root,Time = 1
triggerall = random<249
trigger1 =root,anim = [5120,5122]
value = 5120, random%3
channel=0
[State -3, Hit0]
type = PlaySnd
triggerall = Alive
triggerall = root,Time = 1
triggerall = random<499
trigger1 =root,stateno = 5000
trigger2 =root,stateno = 5010
value = 5000, random%3
channel=0
[State -3, Hit0]
type = PlaySnd
triggerall = Alive
triggerall = root,Time = 1
triggerall = random<499
trigger1 =root,stateno = 5020
trigger2 =root,stateno = 5070
value = 5000, 3+random%4
channel=0
;-----
[State 0, VarSet]
type = parentVarSet
trigger1 = root,winko && root,stateno=3501
v = 19   ;fv = 10
value = 1
;ignorehitpause = 
;persistent = 

;---volt
[State 0, BGPalFX]
type = BGPalFX
trigger1 = var(55)
time = 1
add = 100,-50,-50
mul = 256,256,256
sinadd = 0,0,0,10
invertall = 0
color = 50
;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = VarSet
trigger1 = p2stateno=711
v =55    ;fv = 10
value = 1
[State 0, BGPalFX]
type = BGPalFX
trigger1 = var(55)
trigger1 = p2movetype!=H||p2statetype=L || p2stateno=[5200,5299]
time = 20
add = 100,-50,-50
mul = 256,256,256
sinadd = -100,50,50,50
invertall = 0
color = 256
[State 0, VarSet]
type = VarSet
trigger1 = p2movetype!=H||p2statetype=L || p2stateno=[5200,5299]
trigger2 = var(54)=280
v = 55    ;fv = 10
value = 0
;ignorehitpause = 
;persistent = 
[State 0, VarAdd]
type = VarAdd
trigger1 = var(55)
v =  54   ;fv = 
value = 1
ignorehitpause = 1
[State 0, VarAdd]
type = Varset
trigger1 = !var(55)
v =  54   ;fv = 
value = 0
ignorehitpause = 1


[State 0, PowerAdd]
type = PowerAdd
trigger1 = root,var(1)&&(root,movehit && p2statetype=A && enemy,hitfall||cond(root,numhelper(1001),helper(1001),movehit,0))
value = -1000
ignorehitpause=1
[State 0, VarSet]
type =  parentVarSet
triggerall = root,var(1) 
trigger1 = root,var(0)&&(root,movehit && p2statetype=A && enemy,hitfall||cond(root,numhelper(1001),helper(1001),movehit,0))
trigger2 = !root,var(0)
v = 1    
value = 0
[State 0, VarSet]
type = parentVarSet
triggerall = root,var(0)
trigger1 =((root,stateno!=[1000,1200])&& root,stateno!=[200,699])
trigger2 = p2statetype!=A && root,movehit
v = 0    
value = 0



[State 0, VarSet]
type =  parentVarSet

triggerall=!root,var(0)&& root,hitcount<2
triggerall = root,power>=1000 &&((root,stateno=[1050,1200]))
trigger1=(root,command="z" && var(40) =0)
trigger2 =  root,time=1&& random<(249 * (var(40) ** 2 / 64.0))&&var(40)>0 && var(58)<4
trigger2 =(root,stateno!=1100||p2statetype=A||root,stateno=1200&&root,time=2&&root,var(2)) &&(root,p2bodydist y <-50 && root,stateno=1050 || root,stateno!=1050)
trigger2 = root,var(4)=0
v = 0    
value = 1

[State 0, VarSet]
type =  parentVarSet
triggerall = !root,var(1) && !var(9) && var(55)=0
trigger1 = root,var(0)&&!root,movehit
v = 1    
value = 1
[State 0, VarSet]
type = VarSet
trigger1 = root,var(1)
v = 9   ;fv = 10
value = 1

[State 0, VarSet]
type = VarSet
trigger1 = !root,var(0)
v = 9   ;fv = 10
value = 0


[State 0, VarSet]
type = parentVarSet
trigger1 = 1
fv = 15    
value = root,p2bodydist x+root,var(36)
ignorehitpause =1 

;ignorehitpause = 
;persistent = 
;----damage dampening/cancel frames
[State 0, VarSet]
type = parentVarSet
trigger1 =(p2stateno=51000||p2stateno=[5100,5119]) && root,var(55)=0
v = 55    ;fv = 10,
value = 1
[State 0, VarSet]
type = parentVarSet
trigger1 =root,var(55)=1&&root,movehit
v = 55    ;fv = 10,
value = 2
;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = parentVarSet
trigger1 =p2movetype!=H 
v = 55    ;fv = 10
value = 0


[State 0, VarSet]
type = VarSet
triggerall = var(37)=0
trigger1 = root,movecontact=1&& enemy,hitshakeover
v = 37   
value = 1
[State 0, VarSet]
type = VarSet
triggerall = var(36)=0 && !root,movereversed
trigger1 = root,movehit=1&& enemy,hitshakeover
v = 36  
value = 1
[State 0, VarSet]
type = parentVarSet
trigger1 = root,stateno!=[3000,3500]
fv = 2   
value = fvar(2)
[State 0, VarSet]
type = parentVarSet
trigger1 =  enemy,life <= enemy,lifemax*.95&& root,stateno!=[3000,3500]
fv = 2   
value = .817*fvar(2)
[State 0, VarSet]
type = parentVarSet
trigger1 = enemy,life <= enemy,lifemax*.9&& root,stateno!=[3000,3500]
fv = 2   
value = .759*fvar(2)
[State 0, VarSet]
type = parentVarSet
trigger1 =  enemy,life <= enemy,lifemax*.85&& root,stateno!=[3000,3500]
fv = 2   
value = .72*fvar(2)

[State 0, VarSet]
type = parentVarSet
trigger1 = enemy,life <= enemy,lifemax*.8&& root,stateno!=[3000,3500]
fv = 2   
value = .69*fvar(2)

[State 0, VarSet]
type = parentVarSet
trigger1 = enemy,life <= enemy,lifemax*.75&& root,stateno!=[3000,3500]
fv = 2   
value = .666*fvar(2)

[State 0, VarSet]
type = parentVarSet
trigger1 =  enemy,life <= enemy,lifemax*.70&& root,stateno!=[3000,3500]
fv = 2   
value = .646*fvar(2)

[State 0, VarSet]
type = parentVarSet
trigger1 = enemy,life <= enemy,lifemax*.65&& root,stateno!=[3000,3500]
fv = 2   
value = .628*fvar(2)

[State 0, VarSet]
type = parentVarSet
trigger1 =  enemy,life <= enemy,lifemax*.6&& root,stateno!=[3000,3500]
fv = 2   
value = .612*fvar(2)

[State 0, VarSet]
type = parentVarSet
trigger1 =enemy,life <= enemy,lifemax*.55&& root,stateno!=[3000,3500]
fv = 2   
value = .598*fvar(2)


[State 0, VarSet]
type = parentVarSet
trigger1 = enemy,life <= enemy,lifemax*.55&& root,stateno!=[3000,3500]
fv = 2   
value = .598*fvar(2)



[State 0, VarAdd]
type = VarAdd
trigger1 = enemy,gethitvar(hitshaketime)=1 && root,stateno!=715 || root,time=1 && root,stateno=715 && p2stateno!=[120,155]
trigger1=var(58)=0|| root,anim!=1205 && root,stateno!=[3000,3500]
v = 58    ;fv = 
value = 1
[State 0, VarSet]
type = VarSet
trigger1 = var(58)=0
fv = 2   
value =1
[State 0, VarSet]
type = VarSet
triggerall = var(36)
trigger1 = var(58)=2
fv = 2   
value =.993

[State 0, VarSet]
type =VarSet
triggerall = var(36)
trigger1 = var(58)=3
fv = 2   
value =  .972
[State 0, VarSet]
type =VarSet
triggerall = var(36)
trigger1 =  var(58)=4
fv = 2   
value =  .936
[State 0, VarSet]
type =VarSet
triggerall = var(36)
trigger1 =  var(58)=5
fv = 2   
value = .888
[State 0, VarSet]
type = VarSet
triggerall = var(36)
trigger1 =  var(58)=6
fv = 2   
value = .825
[State 0, VarSet]
type = VarSet
triggerall = var(36)
trigger1 =  var(58)=7
fv = 2   
value =  .748
[State 0, VarSet]
type = VarSet
triggerall = var(36)
trigger1 =var(58)=8
fv = 2   
value =  .657
[State 0, VarSet]
type = VarSet
triggerall = var(36)
trigger1 =  var(58)=9
fv = 2   
value =.552
[State 0, VarSet]
type = VarSet
triggerall = var(36)
trigger1 =  var(58)=10
fv = 2   
value =  .433
[State 0, VarSet]
type = VarSet
triggerall = var(36)
trigger1 =  var(58)=11
fv = 2   
value = .30
[State 0, VarSet]
type = VarSet
triggerall = var(36)
trigger1 = var(58)>=12
fv = 2   
value =  .20
[State 0, VarAdd]
type = Varset
trigger1 = p2movetype!=H || p2stateno=[5200,5299]
v = 58    ;fv = 
value =0


[State 0, VarSet]
type = VarSet
trigger1 = var(37)
sysvar(2) = 10
[State 0, VarSet]
type = VarSet
trigger1 = sysvar(2)>0
sysvar(2) = sysvar(2)-1
[State 0, VarSet]
type = VarSet
trigger1 = var(37)
;trigger2 = root,var(38)
v = 37   
value = 0
[State 0, VarSet]
type = VarSet
trigger1 = var(36)
;trigger2 = root,var(38)
v = 36    
value = 0
;---------------------------
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = invisible
[State 0, DisplayToClipboard]
type = DisplayToClipboard
trigger1 = 1
text = "var(2) = %d var(3) = %d  vel x = %d movehit= %d\nNeutrality by Kamekaze"
params = var(0),var(5),var(30),(root,movecontact)
ignorehitpause = 1
[State 0, VarSet]
type = VarSet
trigger1 = 1
v = 40    
value = root,Ailevel
;ignorehitpause = 
;persistent = 

;persistent = 
[State 0, VarSet]
type = Varset
trigger1 =var(10)>=0
trigger2 =var(11)>=0
trigger3 =var(12)>=0
v = 3   
value = 1
ignorehitpause = 1
[State 0, VarSet]
type = Varset
trigger1 =var(10)>=0
trigger2 =var(11)>=0
trigger3 =var(12)>=0
trigger4 =var(13)>=0
trigger10 =var(20)>=0
trigger11 =var(21)>=0
v = 2   
value = 1
ignorehitpause = 1
[State 0, VarSet]
type = Varset
trigger1 =var(10)=0
trigger1 =var(11)=0
trigger1 =var(12)=0
trigger1 =var(13)=0
trigger1 =var(20)=0
trigger1 =var(21)=0
v = 2   
value = 0
ignorehitpause = 1

[State 0, VarSet]
type = Varset
trigger1 =var(10)=0
trigger1 =var(11)=0
trigger1 =var(12)=0
v = 3   
value = 0
ignorehitpause = 1
;enough for lights
[State 0, Explod]
type = varset
triggerall = var(10)=0
trigger1 = root,movecontact=1 && (root,stateno=600 ) && root,pos y >-35
trigger2 = root,stateno=630 && root,pos y =[-70,-56 ]
trigger3 = root,movecontact=1 && root,stateno=610 && root,pos y =[-60,-45]
trigger4 = root,movecontact=1 && root,stateno=640 && root,pos y =[-85,-71]
trigger5 = root,movecontact=1 && (root,stateno=641)&& root,pos y =[-70,-59]
trigger6 = root,movecontact=1 && root,stateno=610 && root,pos y >-45
trigger7 = root,movecontact=1 && root,stateno=640  && root,pos y >-45
v=10
value=1

;enough for medium
[State 0, Explod]
type = varset
triggerall = var(10)=0
triggerall = var(11)=0
trigger1 = root,movehit=1 && root,stateno=610 && root,pos y >-45
trigger2 = root,movehit=1 && root,stateno=640  && root,pos y >-45
;trigger9 = p2stateno=1007 && p2movetype=H && root,p2bodydist x<40
v=11
value=1





[State 0, VarSet]
type = Varadd
triggerall = enemy,hitshakeover
trigger1 =root,moveguarded=1 
v = 1   
value = 1
ignorehitpause = 0
[State 0, VarSet]
type = VarSet
trigger1 = root,movehit
v = 1    
value = 0
;persistent = 
[State 0, VarSet]
type = Varset
trigger1 =root,statetype=A&& root,movetype!=H
v = 4   
value = 1
ignorehitpause = 1
[State 0, VarSet]
type = Varset
trigger1 =root,statetype=A&& root,movetype=H
v = 4   
value = 2
ignorehitpause = 1
[State 0, VarSet]
type = Varset
trigger1 =var(6)=1
v = 4   
value = 0
ignorehitpause = 1
[State 0, VarSet]
type = Varadd
trigger1 =var(4)=2
v = 5   
value = 1
ignorehitpause = 1
[State 0, VarSet]
type = Varset
trigger1 =root,movehit
trigger2 = root,var(15)
v = 5   
value =0
ignorehitpause = 1 
[State 0, VarSet]
type = Varset
trigger1 = (root,stateno=[5000,5200])&&root,prevstateno=[120,155]
v = 6   
value = p2stateno
ignorehitpause = 1
;persistent = 

[State 0, VarSet]
type = VarSet
trigger1 =  p2stateno=var(6)
v =7   
value = 1
ignorehitpause = 1
;persistent = 
[State 0, VarSet]
type = VarSet
trigger1 =  p2stateno!=var(6)
v =7   
value = 0
ignorehitpause = 1
[State 0, VarSet]
type = VarSet
trigger1 = root,stateno=5120 
v = 8    
value = 10
[State 0, VarSet]
type = Varadd
trigger1 = root,stateno!=5120 && var(8)>0
v = 8    
value = -1

[State 0, VarSet]
type = VarSet
trigger1 = var(8)<0
v = 8    
value = 0

;bait
[State 0, Explod]
type = varset
triggerall = var(10)=0
triggerall = var(11)=0
triggerall = var(12)=0
triggerall = var(13)=0
;triggerall = var(1)>3
trigger1 = root,moveguarded=1 &&root,stateno=200
trigger2 = root,moveguarded=1&& root,stateno=430 
trigger3 = root,moveguarded=1&& root,stateno=230
trigger4 = root,moveguarded=1&& root,stateno=400
v=13
value=1

[State 0, Explod]
type = varset
trigger1= enemy,const(size.head.pos.y)<=-60
v=14
value=1
ignorehitpause =1

[State 0, VarSet]
type = VarSet
trigger1 = root,prevstateno=[190,199]
v = 19   
value = 49
;ignorehitpause = 
;persistent = 
[State 0, VarAdd]
type = VarAdd
trigger1 = var(19)>0 && roundstate=2
v = 19    ;fv = 
value = -1

[State 0, VarRandom]
type = VarRandom
trigger1 = 1
v = 31
range = 0,999
;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = VarSet
triggerall = p2statetype=A && root,movecontact
trigger1 =  stateno=[600,640]
v = 23    
value = 1
;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = VarSet
trigger1 = p2statetype!=A && root,movecontact
trigger2 =  root,numprojid(999)>0
trigger3 = p2movetype!=H
v = 23    
value = 0

;-projectiles
;1000
[State 0, Explod]
type = varset
triggerall = var(20)=0
triggerall = root,numprojid(999)=0
triggerall = (root,p2bodydist x =[60,145])
triggerall =  !root,movecontact
triggerall = root,movetype!=H
triggerall =  (root,ctrl||(root,stateno=[100,101])||root,stateno=[10,20]) 
trigger1= root,p2bodydist x-16<= var(0) && enemy,pos y >=0 && var(0)>-1&&  root,p2bodydist x >75
trigger2= random<125&&((p2statetype!=A||root,p2bodydist y =[-85,-30])&& (enemy,vel y >=0 && !enemy,hitfall))&&root,p2bodydist x >=75
;trigger3 = root,movecontact 
v=20
value=1
ignorehitpause =1
;1001
[State 1, Explod]
type = varset
triggerall = var(21)=0
triggerall = root,numprojid(999)=0
triggerall = (root,p2bodydist x >145)
triggerall =  !root,movecontact
triggerall = root,movetype!=H
triggerall = (root,ctrl||(root,stateno=[100,101])||root,stateno=[10,20]) 
trigger1= root,p2bodydist x<= var(0) && enemy,pos y >=0 && var(0)>-1&&  root,p2bodydist x >75
trigger2= random<125&&((p2statetype!=A||root,p2bodydist y =[-85,-30])&& (enemy,vel y >=0 && !enemy,hitfall))&&root,p2bodydist x >=115
v=21
value=1
ignorehitpause =1


;ignorehitpause = 
;persistent = 
[State 25, VarSet]
type = VarSet
triggerall = random <249  && p2stateno!=1007
triggerall = p2statetype!=A|| p2movetype=H 
trigger1 = ((enemy,movetype !=A)|| root,p2bodydist x >65)&& p2statetype!=L  
trigger2 = root,backedgebodydist <10 && p2movetype=A
trigger3 = root,p2bodydist y <0 && p2statetype=A  
trigger4 = (var(12) || var(11)||var(10))  

v = 25   
value = 1



;---adjust for p2's position
[State 0, VarSet]
type = Varadd
trigger1 = p2statetype=L &&(anim=5160|| enemy,anim=[612,614])
v = 0    
value = 1
;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = VarSet
trigger1 =  p2statetype!=L
v = 0    
value = -1
;ignorehitpause = 
;persistent = 

;0----------removeexplods---
[State 0, VarRangeSet]
type = VarRangeSet
trigger1 = p2movetype!=H 
trigger2 = p2statetype=A
trigger3 = root,movecontact && root,statetype!=A && root,stateno!=1050
value = 0 ;fvalue = 0
first = 10
last = 12 ;39
;ignorehitpause = 
;persistent = 



[State 0, RemoveExplod]
type = varset
trigger1 = p2stateno=5901||root,movehit=1
v = 13
value=0
ignorehitpause = 1
;persistent = 
[State 0, VarSet]
type = VarSet
trigger1 = root,stateno!=1030
v = 15   
value = 0
;ignorehitpause = 
;persistent = 

;200
[State 0, RemoveExplod]
type = varset
trigger1 = (root,numprojid(999)>0 || root,movetype=H)&& !root,movecontact
trigger2= (root,p2bodydist x !=[60,145])  && !root,movecontact && p2statetype!=L
trigger3= var(21)
v = 20
value=0
;ignorehitpause = 1
;230
[State 0, RemoveExplod]
type = varset
trigger1 = (root,numprojid(999)>0|| root,movetype=H)&& !root,movecontact
trigger2= (root,p2bodydist x <145) && !root,movecontact&& p2statetype!=L
trigger3 = var(20) 
v=21
value=0
;ignorehitpause = 1

;ignorehitpause = 1
[State 25, VarSet]
type = VarSet
triggerall = root,backedgebodydist >10
trigger1 =  enemy,movetype =A
trigger2 = root,p2bodydist x <65 &&(p2statetype=L)&& root,p2bodydist y=0
;trigger3 = p2statetype=A && p2movetype!=H&& root,p2bodydist x <25&& root,var(31)=0
;trigger4 = root,var(31)>0 && p2bodydist x <25 && root,var(31)!=6 
v = 25   
value = 0

;-----------
 [State 0, VarSet]
type = VarSet
triggerall = helper(10002),var(30)=0
trigger1 = root,statetype = A
trigger2 = root,movetype=H && root,stateno!=[120,155]
trigger3= root,prevstateno=40
trigger4 = (root,prevstateno=52 ||root,prevstateno=5120) && p2statetype=A
trigger5 = root,p2bodydist x <45 && root,frontedgebodydist >70 && p2statetype!=L&&p2stateno!=711&&p2stateno!=[5210,5211]
trigger6 = stateno=100 && root,p2bodydist x <100 
v=30
value = 0

[State 0, VarSet]
type = VarSet
triggerall = root,statetype != A
triggerall = (var(8)<=0) ||enemy,hitdefattr=SC,AT 
triggerall =  cond(var(40)>0, var(31) <ceil(((699*1.0)*(fvar(5)/(var(40)*1.0)))),0)||enemy,hitdefattr=SC,AT || helper(10002),var(30)
triggerall = root,p2bodydist x >45 || root,frontedgebodydist <60 || p2stateno=5120||enemy,hitdefattr=SC,AT ||p2stateno=711|| helper(10002),var(30)
trigger1= enemy,hitdefattr=SC,AT && (root,ctrl||root,stateno=20||root,stateno=100)
trigger2= (p2stateno =[5100,5120]) && (root,p2bodydist x =[45,80]) && (root,ctrl||root,stateno=20||root,stateno=100) && random%4<2
trigger3= p2stateno =51000&&enemy,time>9 && root,frontedgedist <60 &&(root,ctrl||root,stateno=20||root,stateno=100)&& random%4>1
trigger4 = ((root,p2bodydist x=[75,130])||root,frontedgedist <40)&& (root,ctrl||root,stateno=20||root,stateno=100) && root,movetype!=H&&(p2movetype=H || p2bodydist x >95) 
trigger5 =  root,backedgebodydist <30 && p2statetype=L && (root,ctrl||root,stateno=20||root,stateno=100) && p2bodydist x <130
trigger6 = ((root,p2bodydist x=[cond(p2statetype=L||p2statetype=C,60,105),165])||root,frontedgedist <40)&& (root,ctrl||root,stateno=20||root,stateno=100) && root,movetype!=H
trigger7=(root,ctrl||root,stateno=20||root,stateno=100)&&  ( helper(10002),var(30)||p2stateno=711||p2stateno=[5210,5211])

v = 30   ;fv = 10
value = 1

[State 0, VarSet]
type = Varset;how often should I jump?
trigger1 = time=0
fv = 5   ;fv = 10
value = 1.0
[State 0, VarAdd]
type = VarAdd
trigger1 = fvar(5)<1.0 && time%240=0
fv =5    ;fv = 
value = .15*fvar(5)
[State 0, VarSet]
type = Varset
triggerall = var(39)
triggerall=enemy,stateno=[200,699]
trigger1 = root,movetype=H && root,statetype=A && root,stateno!=[120,155]
trigger1 = root,gethitvar(hitshaketime)=1
fv = 5   ;fv = 10
value = fvar(5)*.40

[State 0, VarSet]
type = Varset
triggerall = var(39)
triggerall=enemy,stateno=[1000,1999]
trigger1 = root,movetype=H && root,statetype=A && root,stateno!=[120,155]
trigger1 = root,gethitvar(hitshaketime)=1
fv = 5   ;fv = 10
value = fvar(5)*.25

[State 0, VarSet]
type = Varset
triggerall = var(39)
triggerall=enemy,stateno=[2000,3999]
trigger1 = root,movetype=H && root,statetype=A && root,stateno!=[120,155]
trigger1 = root,gethitvar(hitshaketime)=1
fv = 5   ;fv = 10
value = fvar(5)*.40
[State 0, VarSet]
type = Varset
trigger1 =root,statetype=A&& root,movetype!=H
v = 39   ;fv = 10
value = 1
ignorehitpause = 1
[State 0, VarSet]
type = Varset
trigger1 =root,statetype=A&&root,movetype=H&& root,stateno=[5030,5050]
v =39   ;fv = 10
value = 2
ignorehitpause = 1
[State 0, VarSet]
type = Varset
trigger1 =root,statetype!=A
v = 39  ;fv = 10
value = 0
ignorehitpause = 1
[State 0, VarSet]
type = Varset
trigger1 =var(40)=2
v = 41   ;fv = 10
value = 1
ignorehitpause = 1
[State 0, VarSet]
type = Varset
triggerall =var(40)>0
trigger1 =root,movehit
trigger2 = root,var(15)
trigger3= var(42)%(30*var(40))=0
v = 41   ;fv = 10
value =0
ignorehitpause = 1
[State 0, VarSet]
type = VarSet
trigger1 =  var(41)=0
v = 42    ;fv = 10
value = 0
[State 0, VarSet]
type = Varadd
trigger1 = var(41)=1
v = 42    ;fv = 10
value = 1

