;劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒
;抂敾掕梡Helper40000
;劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒
[Statedef 40000]
type=A
movetype=I
physics=N
ctrl=0
anim=8000
sprpriority=0
velset = 10,0

[State 9741]
type=selfstate
trigger1=!ishelper
value=0

[State 825]
type = assertspecial
trigger1=1
flag=invisible

[State -2]
type=Nothitby
trigger1=1
value=SCA

[State 40000]
type=ScreenBound
trigger1=numhelper(40000)
value=0
movecamera=0,0

[State 40000]
type=projectile
trigger1=numhelper(40000)
trigger1=time=0
projID=40001
projanim=9999
velocity=10,0
projpriority=4
projsprpriority=2
projstagebound=0
projedgebound=99999
offset=0,0
postype=right
supermovetime=99999
pausemovetime=99999
projremovetime=-1

[State -2]
type=velset
trigger1=numhelper(40000)
trigger1=!(root,numprojID(40001))
x=0
y=0

[State -2,僐儞儃梡]
type=varrandom
trigger1=var(1)=0
v=0
range=1,2
ignorehitpause=1

[State -2,僐儞儃梡]
type=varset
trigger1=p2statetype=L
trigger2=p2movetype!=H
var(1)=0

[State -2,僐儞儃梡]
type=varset
triggerall=var(1)<=0
trigger1=root,stateno=400
trigger1=root,movecontact=1
trigger1=p2movetype=H
trigger1=p2stateno!=[120,159]
var(1)=var(0)
ignorehitpause=1

[State -2,僐儞儃梡]
type=varset
triggerall=var(1)=1
trigger1=root,stateno=400
trigger1=root,movecontact
trigger1=p2movetype=H
trigger1=p2stateno!=[120,159]
trigger1=p2statetype=C
var(1)=2
ignorehitpause=1

[State -2,憡庤嬻拞僕儍儞僾]
type=varset
trigger1=p2statetype!=A
var(2)=0
ignorehitpause=1

[State -2,憡庤嬻拞僕儍儞僾]
type=varadd
triggerall=p2statetype=A
trigger1=(p2stateno=[38,45])||p2stateno=99||(p2stateno=[110,115])
trigger1=playerID(root,var(58)),time=1
var(2)=1
ignorehitpause=1

[State Debug Display]
type = DisplayToClipboard
text = "Comob:%d EAM:%d\n"
params = var(1),var(2)
trigger1 = 1
;劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒
;抂敾掕梡Helper40010
;劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒
[Statedef 40010]
type=A
movetype=I
physics=N
ctrl=0
anim=8000
sprpriority=0
velset=10,0

[State 9741]
type=selfstate
trigger1=!ishelper
value=0

[State 825]
type = assertspecial
trigger1=1
flag = invisible

[State -2]
type=Nothitby
trigger1=1
value=SCA

[State 40010]
type=ScreenBound
trigger1=1
value=0
movecamera=0,0

[State 40010]
type=projectile
trigger1=numhelper(40010)
trigger1=time=0
projID=40002
projanim=9999
velocity=10,0
projpriority=4
projsprpriority=2
projstagebound=0
projedgebound=99999
offset=0,0
postype=left
supermovetime=99999
pausemovetime=99999
projremovetime=-1

[State -2]
type=velset
trigger1=numhelper(40010)
trigger1=!(root,numprojID(40002))
x=0
y=0

[State -2]
type=varadd
trigger1=var(0)>0
var(0)=-1
ignorehitpause=1

[State -2]
type=varset
triggerall=var(0)>0
trigger1=root,movetype!=H
var(0)=0

[State -2,僈乕僪峝捈]
type=varset
triggerall=root,movetype=H
triggerall=root,stateno<200
triggerall=root,statetype!=A
trigger1=!root,gethitvar(fall)
trigger1=!(root,hitshakeover)
trigger1=root,time=1||var(0)=0
var(0)=ifelse(root,gethitvar(ctrltime)<root,gethitvar(hittime),root,gethitvar(ctrltime),root,gethitvar(hittime))+root,gethitvar(hitshaketime)+1
ignorehitpause=1

[State -2]
type=varset
triggerall=var(1)>0
trigger1=root,movetype!=H
var(1)=0
ignorehitpause=1

[State -2]
type=varadd
triggerall=var(0)>0
trigger1=root,time=1
trigger1=root,stateno=[120,159]
trigger1=playerID(root,var(58)),moveguarded=1
var(1)=1
ignorehitpause=1

[State Debug Display]
type = DisplayToClipboard
text = "Guard:%d GC:%d\n"
params = var(0),var(1)
trigger1 = 1
ignorehitpause=1
;劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒
;僈乕僪曗彆僿儖僷乕
;劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒
[Statedef 60000]
type=A
movetype=I
physics=N
ctrl=0
anim=8000
sprpriority=0
velset=0,0

[State 825]
type=assertspecial
trigger1 = numhelper(60000)
flag = invisible

[State -2]
type=Nothitby
trigger1 = numhelper(60000)
value=SCA

[State -2]
type=turn
trigger1=numhelper(60000)
trigger1=facing!=root,facing

[State -2]
type=posset
trigger1 = numhelper(60000)
x=root,pos x-facing*80

[State -2,慜曕偒梡]
type=varset
trigger1=1
var(1)=0
IgnoreHitPause=1

[State -2,慜曕偒梡]
type=varset
triggerall=root,var(59)>0
triggerall=root,fvar(38)>0
trigger1=p2movetype=H
trigger1=p2statetype!=L
trigger1=p2stateno!=[120,159]
trigger1=root,p2bodydist x>1
trigger2=numhelper(1301)||power>2999
trigger2=p2movetype=I
trigger2=p2statetype!=A||(p2statetype=A&&playerID(root,var(58)),vel x<=0)
trigger2=root,p2bodydist x>(100-random/25)
trigger3=!playerID(root,var(58)),ctrl
trigger3=p2movetype!=H
trigger3=p2statetype!=L
trigger3=root,p2bodydist x=[51,140]
trigger3=p2stateno>199
trigger3=!root,inguarddist
var(1)=1
IgnoreHitPause=1

[State -2,屻曕偒梡]
type=varset
triggerall=root,var(59)>0
trigger1=p2movetype!=H
trigger1=!numhelper(1301)
trigger1=power<3000
trigger2=p2movetype!=H
trigger2=numhelper(1301)
trigger2=helper(1301),time>=400
trigger2=power<3000
trigger3=root,fvar(38)=0
trigger3=root,p2dist x>0
trigger3=root,p2bodydist x<60
trigger4=p2movetype=I||(p2stateno=[120,159])
trigger4=root,p2bodydist x<(100+random/50)
trigger5=p2statetype=A
trigger5=p2movetype!=H
trigger5=root,p2bodydist x-playerID(root,var(58)),vel x*2=[0,60]
trigger5=root,p2bodydist y+(playerID(root,var(58)),vel y!=0)*(playerID(root,var(58)),vel y+playerID(root,var(58)),const(movement.yaccel)*1)*2=[-200,0]
trigger5=playerID(root,var(58)),facing=root,facing
trigger5=playerID(root,var(58)),vel x>=0
trigger6=p2statetype=A
trigger6=p2movetype!=H
trigger6=root,p2dist x>0
trigger6=root,p2bodydist x-playerID(root,var(58)),vel x*2>100
trigger6=root,p2bodydist y+(playerID(root,var(58)),vel y!=0)*(playerID(root,var(58)),vel y+playerID(root,var(58)),const(movement.yaccel)*1)*2=[-200,-80]
trigger6=playerID(root,var(58)),vel x=[1,4]
var(1)=2
IgnoreHitPause=1

[State -2,婲偒忋偑傝敾抐梡]
type=varset
triggerall=!var(2)
trigger1=p2statetype=L
trigger1=p2stateno>=5120
trigger1=playerID(root,var(58)),vel x=0
var(2)=1
IgnoreHitPause=1

[State -2,婲偒忋偑傝敾抐梡]
type=varset
triggerall=!var(2)
trigger1=p2statetype=L
trigger1=p2stateno>=5120
trigger1=playerID(root,var(58)),vel x!=0
var(2)=2
IgnoreHitPause=1

[State -2]
type=varset
triggerall=p2stateno!=0
trigger1=p2stateno=var(11)
trigger2=p2stateno=var(12)
trigger3=p2stateno=var(13)
trigger4=p2stateno=var(14)
var(10)=ifelse(root,statetype=C,1,0)

[State -2,婰壇梡]
type=varset
trigger1=playerID(root,var(58)),stateno>=200
trigger1=playerID(root,var(58)),stateno!=var(11)&&playerID(root,var(58)),prevstateno!=var(11)
trigger1=playerID(root,var(58)),stateno!=var(12)&&playerID(root,var(58)),prevstateno!=var(12)
trigger1=playerID(root,var(58)),stateno!=var(13)&&playerID(root,var(58)),prevstateno!=var(13)
trigger1=var(11)&&var(12)&&var(13)&&!var(14)
trigger1=root,movetype=H||root,statetype=L
trigger1=root,stateno!=[120,155]
trigger1=root,prevstateno=[120,155]
var(14)=playerID(root,var(58)),stateno

[State -2,婰壇梡]
type=varset
trigger1=playerID(root,var(58)),stateno>=200
trigger1=playerID(root,var(58)),stateno!=var(11)&&playerID(root,var(58)),prevstateno!=var(11)
trigger1=playerID(root,var(58)),stateno!=var(12)&&playerID(root,var(58)),prevstateno!=var(12)
trigger1=var(11)&&var(12)&&!var(13)
trigger1=root,movetype=H||root,statetype=L
trigger1=root,stateno!=[120,155]
trigger1=root,prevstateno=[120,155]
var(13)=playerID(root,var(58)),stateno

[State -2,婰壇梡]
type=varset
trigger1=playerID(root,var(58)),stateno>=200
trigger1=playerID(root,var(58)),stateno!=var(11)
trigger1=playerID(root,var(58)),prevstateno!=var(11)
trigger1=var(11)&&!var(12)
trigger1=root,movetype=H &&(root,stateno!=[120,155])
trigger1=root,prevstateno=[120,155]
var(12)=playerID(root,var(58)),stateno

[State -2,婰壇梡]
type=varset
trigger1=!var(11)
trigger1=root,movetype=H &&(root,stateno!=[120,155])
trigger1=root,prevstateno=[120,155]
var(11)=playerID(root,var(58)),stateno

[State -2,婰壇梡]
type=varset
trigger1=var(15)&&!var(16)
trigger1=playerID(root,var(58)),stateno!=var(15)
trigger1=p2stateno=[200,4999]
trigger1=!inguarddist
trigger1=root,movetype=H
trigger1=root,stateno=[5000,5100]
var(16)=playerID(root,var(58)),stateno

[State -2,婰壇梡]
type=varset
trugger1=!var(15)
trigger1=p2stateno=[200,4999]
trigger1=!inguarddist
trigger1=root,movetype=H
trigger1=root,stateno=[5000,5100]
var(15)=playerID(root,var(58)),stateno

[State -2,婰壇梡]
type=varset
triggerall=var(17)
triggerall=p2stateno!=var(17)
triggerall=playerID(root,var(58)),stateno>=200
triggerall=playerID(root,var(58)),stateno!=var(17)
triggerall=playerID(root,var(58)),prevstateno!=var(17)
triggerall=root,statetype=C
triggerall=root,movetype=H &&(root,stateno!=[120,155])
triggerall=root,prevstateno=[120,155]
triggerall=root,time=1
trigger1=p2stateno=var(11)
trigger2=p2stateno=var(12)
trigger3=p2stateno=var(13)
trigger4=p2stateno=var(14)
var(18)=playerID(root,var(58)),stateno

[State -2,婰壇梡]
type=varset
triggerall=root,statetype=C
triggerall=root,movetype=H&&(root,stateno!=[120,155])
triggerall=root,prevstateno=[120,155]
triggerall=root,time=1
trigger1=p2stateno=var(11)
trigger2=p2stateno=var(12)
trigger3=p2stateno=var(13)
trigger4=p2stateno=var(14)
var(17)=playerID(root,var(58)),stateno

[State -2,婰壇梡]
type = VarSet
triggerall=playerID(root,var(58)),movetype!=I
trigger1=root,statetype=C
var(10)=1

[State Append]
type = AppendToClipboard
text = "LED:%.0f RED:%.0f E_BED:%.0f E_FED:%.0f p2dx:%.0f\n"
params = root,fvar(36),root,fvar(37),root,fvar(35),root,fvar(34),root,p2dist x
trigger1 = 1
;劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒
;AI Helper
;劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒
[StateDef 20000]
anim=8000
ctrl=0

[State 825]
type = assertspecial
trigger1 = 1
flag = invisible

[State 20000,娫堘偄偱杮懱偑棃偨傜棫偪傊堏峴]
type=selfstate
trigger1=!ishelper
value=0

[State 20000,僾儗僀儎乕敾掕]
type=varset
Trigger1=command="a"&&root,command="a"
Trigger2=command="b"&&root,command="b"
Trigger3=command="c"&&root,command="c"
Trigger4=command="x"&&root,command="x"
Trigger5=command="y"&&root,command="y"
Trigger6=command="z"&&root,command="z"
Trigger7=command="start"&&root,command="start"
Trigger8=command="fwd"&&root,command="fwd"
Trigger9=command="back"&&root,command="back"
Trigger10=command="up"&&root,command="up"
Trigger11=command="down"&&root,command="down"
var(59)=-1

[State 20000,僾儗僀儎乕敾掕]
type=parentvarset
Trigger1=command="a"&&root,command="a"
Trigger2=command="b"&&root,command="b"
Trigger3=command="c"&&root,command="c"
Trigger4=command="x"&&root,command="x"
Trigger5=command="y"&&root,command="y"
Trigger6=command="z"&&root,command="z"
Trigger7=command="start"&&root,command="start"
Trigger8=command="fwd"&&root,command="fwd"
Trigger9=command="back"&&root,command="back"
Trigger10=command="up"&&root,command="up"
Trigger11=command="down"&&root,command="down"
var(59)=-1

[State 20000,棫偭偨傜徚幐]
Type = DestroySelf
TriggerAll=isHelper
Trigger1=root,var(59)!=0||var(59)=-1
Trigger2=command="a"&&root,command="a"
Trigger3=command="b"&&root,command="b"
Trigger4=command="c"&&root,command="c"
Trigger5=command="x"&&root,command="x"
Trigger6=command="y"&&root,command="y"
Trigger7=command="z"&&root,command="z"
Trigger8=command="start"&&root,command="start"
Trigger9=command="fwd"&&root,command="fwd"
Trigger10=command="back"&&root,command="back"
Trigger11=command="up"&&root,command="up"
Trigger12=command="down"&&root,command="down"

[State 20000,AI套皋ON]
Type=varset
TriggerAll=var(59)!=-1
Trigger1=root,command="a"
Trigger2=root,command="b"
Trigger3=root,command="c"
Trigger4=root,command="x"
Trigger5=root,command="y"
Trigger6=root,command="z"
Trigger7=root,command="start"
Trigger8=root,command="fwd"&&(roundstate=2&&root,stateno=0)
Trigger9=root,command="back"&&(roundstate=2&&root,stateno=0)
Trigger10=root,command="up"&&(roundstate=2&&root,stateno=0)
Trigger11=root,command="down"&&(roundstate=2&&root,stateno=0)
Trigger12=root,command="fwd"&&(roundstate=2&&root,ctrl)
Trigger13=root,command="back"&&(roundstate=2&&root,ctrl)
Trigger14=root,command="up"&&(roundstate=2&&root,ctrl)
Trigger15=root,command="down"&&(roundstate=2&&root,ctrl)
var(59)=1