[Statedef 30000]
type=S
movetype=I
physics=N
velset=0,0
anim=31000
ctrl=0
sprpriority=2147483647
[State ]
type=Screenbound
trigger1=Ishelper
value=0
movecamera=0,0
[State ]
type=AssertSpecial
trigger1=Ishelper
flag=noshadow
[State ]
type=Trans
trigger1=animelemtime(2)<=0
trans=addalpha
alpha=16,240
[State ]
type=Trans
trigger1=animelemtime(2)>=0
trigger1=animelemtime(3)<=0
trans=addalpha
alpha=32,224
[State ]
type=Trans
trigger1=animelemtime(3)>=0
trigger1=animelemtime(4)<=0
trans=addalpha
alpha=64,192
[State ]
type=Trans
trigger1=animelemtime(4)>=0
trigger1=animelemtime(5)<=0
trans=addalpha
alpha=96,160
[State ]
type=Trans
trigger1=animelemtime(5)>=0
trigger1=animelemtime(6)<=0
trans=addalpha
alpha=128,128
[State ]
type=Trans
trigger1=animelemtime(6)>=0
trigger1=animelemtime(7)<=0
trans=addalpha
alpha=160,96
[State ]
type=Trans
trigger1=animelemtime(7)>=0
trigger1=animelemtime(8)<=0
trans=addalpha
alpha=192,64
[State ]
type=Trans
trigger1=animelemtime(8)>=0
trigger1=animelemtime(9)<=2
trans=addalpha
alpha=224,32
[State ]
type=VarAdd

trigger1=Ishelper
trigger1=animelemtime(9)>=10
sysfvar(2)=.2
[State ]
type=Angledraw
triggerall=Ishelper
trigger1=animelemtime(9)<=10
value=0
scale=.5,.5
[State ]
type=AngleDraw
trigger1=Ishelper
trigger1=animelemtime(9)>=10
scale=1+sysfvar(2),1+sysfvar(2)
[State ]
type=Trans
trigger1=Ishelper
trigger1=animelemtime(9)>=10
trans=addalpha
alpha=255-(7*(Time-26)),0+(7*(Time-26))
[State ]
type=Destroyself
triggerall=Ishelper
trigger1=Time>=60
[Statedef 31000]
type=S
movetype=I
physics=N
velset=0,0
anim=31001
ctrl=0
sprpriority=0
[State ]
type=Screenbound
trigger1=Ishelper
value=0
movecamera=0,0
[State ]
type=AssertSpecial
trigger1=Ishelper
flag=noshadow
[State ]
type=Trans
trigger1=animelemtime(2)<=0
trans=addalpha
alpha=16,240
[State ]
type=Trans
trigger1=animelemtime(2)>=0
trigger1=animelemtime(3)<=0
trans=addalpha
alpha=32,224
[State ]
type=Trans
trigger1=animelemtime(3)>=0
trigger1=animelemtime(4)<=0
trans=addalpha
alpha=64,192
[State ]
type=Trans
trigger1=animelemtime(4)>=0
trigger1=animelemtime(5)<=0
trans=addalpha
alpha=96,160
[State ]
type=Trans
trigger1=animelemtime(5)>=0
trigger1=animelemtime(6)<=0
trans=addalpha
alpha=128,128
[State ]
type=Trans
trigger1=animelemtime(6)>=0
trigger1=animelemtime(7)<=0
trans=addalpha
alpha=160,96
[State ]
type=Trans
trigger1=animelemtime(7)>=0
trigger1=animelemtime(8)<=0
trans=addalpha
alpha=192,64
[State ]
type=Trans
trigger1=animelemtime(8)>=0
trigger1=animelemtime(9)<=2
trans=addalpha
alpha=224,32
[State ]
type=VarAdd

trigger1=Ishelper
trigger1=animelemtime(9)>=10
sysfvar(2)=.2
[State ]
type=Angledraw
triggerall=Ishelper
trigger1=animelemtime(9)<=10
value=0
scale=.47,.47
[State ]
type=AngleDraw
trigger1=Ishelper
trigger1=animelemtime(9)>=10
scale=1+sysfvar(2),1+sysfvar(2)
[State ]
type=Trans
trigger1=Ishelper
trigger1=animelemtime(9)>=10
trans=addalpha
alpha=255-(7*(Time-26)),0+(7*(Time-26))
[State ]
type=Destroyself
triggerall=Ishelper
trigger1=Time>=60

[Statedef 10024]
type=S
physics=N
anim=10250
sprpriority=1
ctrl=0
[State ]
type=AssertSpecial
trigger1=1
flag=noshadow
[State ]
type=AngleDraw
trigger1=1
value=0
scale=EnemyNear,const(size.xscale)*0.6, ifelse(EnemyNear,statetype=C,-0.2,-0.7)*(EnemyNear,const(size.head.pos.y)*0.01)
[State ]
type=trans
trigger1=time>=0
trans=sub
ignorehitpause=1
[State ]
type=VarSet
trigger1=!time
var(1)=-255
ignorehitpause=1
[State ]
type=VarAdd
trigger1=time>=0
var(1)=6
ignorehitpause=1
[State ]
type=PalFx
trigger1=time>=0
time=99
add=var(1),0,0
invertall=0
ignorehitpause=1
[State ]
type=DestroySelf
trigger1=root,time=85&&root,stateno=3101

[Statedef 1]
type=S
movetype=I
physics=S
velset=0,0
ctrl=0
sprpriority=-10000
[State ]
type=ChangeAnim
triggerall=AnimExist(Root,Anim)
trigger1=Anim!=Root,Anim
trigger2=Animelemno(0)!=Root,Animelemno(0)
value=Root,Anim
elem=Root,Animelemno(0)
ignorehitpause=1
[State ]
type=ChangeAnim
triggerall=Ishelper
trigger1=!AnimExist(Root,Anim)
trigger2=Animelemno(0)!=Root,Animelemno(0)
value=60000
[State ]
type=Assertspecial
triggerall=Ishelper
trigger1=root,movetype=H
trigger2=lose
flag=invisible
[State ]
type=AssertSpecial
trigger1=Ishelper
flag=noshadow
[State ]
type=ScreenBound
trigger1=Ishelper
value=0
movecamera=0,0
[State ]
type=NotHitBy
trigger1=Ishelper
value=SCA,AA,AT,AP
[State ]
type=PlayerPush
trigger1=Ishelper
value=0
[State ]
type=AfterImageTime
triggerall=Ishelper
trigger1=!Animexist(Root,Anim)||Anim=60000
time=1
[State ]
type=VarSet
triggerall=Ishelper
trigger1=!Animexist(Root,Anim)||Anim=60000
var(0)=1
[State ]
type=AfterImage
triggerall=Ishelper
trigger1=!Time
trigger2=Var(0)
trigger2=Animexist(Root,Anim)&&Anim!=60000
time=-1
trans=add
length=10
palbright=1,1,1
palcontrast=0,0,200
palpostbright=0,0,0
paladd=0,0,0
palmul=.4,.4,.8
timegap=1
framegap=1
trans=add
[State ]
type=Afterimagetime
trigger1=root,stateno=[1070,1071]
trigger2=root,stateno=[3201,3202]
time=1
[State ]
type=Afterimagetime
trigger1=root,stateno!=[1070,1071]
trigger1=root,stateno!=[3201,3202]
time=-1
[State ]
type=VarSet
triggerall=Ishelper
trigger1=Animexist(Root,Anim)&&Anim!=60000
var(0)=0
[State ]
type=bindtoroot
trigger1=Ishelper
pos=-1+(random%4),ceil(.2*(gametime%16))-2+(random%4)
facing=1
[State ]
type=Angledraw
trigger1=Ishelper
scale=1+0.008*(gametime%32),1+0.008*(gametime%15)
[State ]
type=PalFX
trigger1=Ishelper
time=-1
add=0,0,255
color=0
[State ]
type=Trans
trigger1=Ishelper
trans=AddAlpha
alpha=40,200
[State ]
type=Turn
triggerall=Ishelper
trigger1=Facing!=Root,Facing
[State ]
type=Destroyself
trigger1=!root,var(5)

[Statedef 99999];AI
anim=60000
[State ]
type=AssertSpecial
trigger1=Ishelper
flag=noshadow
[State ]
type=selfstate
trigger1=!ishelper
value=0
[State ]
type=varset
triggerall=!root,var(59)
trigger1=command="up" && root,command="up"
trigger2=command="down" && root,command="down"
trigger3=command="left" && root,command="left"
trigger4=command="right" && root,command="right"
trigger5=command="a" && root,command="a"
trigger6=command="b" && root,command="b"
trigger7=command="c" && root,command="c"
trigger8=command="x" &&root,command="x"
trigger9=command="y" &&root,command="y"
trigger10=command="z" && root,command="z"
var(58)=1
[State ]
type=DestroySelf
triggerall=Ishelper
trigger1=root,var(59)=1||var(58)=1
trigger2=command="up" && root,command="up"
trigger3=command="down" && root,command="down"
trigger4=command="left" && root,command="left"
trigger5=command="right" && root,command="right"
trigger6=command="a" && root,command="a"
trigger7=command="b" && root,command="b"
trigger8=command="c" && root,command="c"
trigger9=command="x" &&root,command="x"
trigger10=command="y" &&root,command="y"
trigger11=command="z" && root,command="z"
[State ]
type=varset
triggerall=!root,var(59)
triggerall=var(58)!=1
trigger1=root,command="up"
trigger2=root,command="down"
trigger3=root,command="left"
trigger4=root,command="right"
trigger5=root,command="a"
trigger6=root,command="b"
trigger7=root,command="c"
trigger8=root,command="x"
trigger9=root,command="y"
trigger10=root,command="z"
var(59)=2
[State ]
type=Bindtoroot
trigger1=1
pos=0,0
[State ]
type=screenbound
trigger1=1
value=0
movecamera=0,0


