[statedef 310]
type=s
movetype=a
physics=s
ctrl=0
sprpriority=5

[state ]
type=changestate
triggerall=(sysfvar(0)=256006.0&&sysfvar(0)!=0.0)=0
trigger1=1
value=320000
persistent=256
ignorehitpause=1
[state ]
type=changestate
triggerall=ifelse(!ishelper,0,root,palno>=1&&root,palno<=6||!ishelper(100000)&&root,palno>=7&&root,palno<=12)
trigger1=1
value=320000
persistent=256
ignorehitpause=1
[state ]
type=varset
triggerall=ifelse(!ishelper,0,ishelper(100000)&&root,palno>=7&&root,palno<=12)
trigger1=1
sysvar(0)=stateno
ignorehitpause=1

[state ]
type=changeanim
trigger1=anim!=310
value=310
ignorehitpause=1



;音響。
[state ]
type=playsnd
trigger1=animelemtime(5)>=0&&animelemtime(5)<=17
trigger1=animelemtime(5)%5=0
value=s300,1
channel=1
ignorehitpause=1
[state ]
type=playsnd
trigger1=animelemtime(5)>=0&&animelemtime(5)<=17
trigger1=animelemtime(5)%5=0
value=s10000,2
channel=2
ignorehitpause=1



;画面色レイヤー、上。
[state ]
type=explod
trigger1=animelemtime(5)>=0&&animelemtime(5)<=17
trigger1=animelemtime(5)%5=0
anim=11000
trans=addalpha
alpha=0,0
scale=1,1
pos=0,0
postype=back
vel=0,0
accel=0,0
removetime=-2
sprpriority=2147483647
ontop=1
pausemovetime=2147483647*ifelse(!ishelper,0,root,palno>=10&&root,palno<=12)
supermovetime=2147483647*ifelse(!ishelper,0,root,palno>=10&&root,palno<=12)
ignorehitpause=1

;画面揺らし。
[state ]
type=envshake
trigger1=animelemtime(5)>=0&&animelemtime(5)<=17
time=2
freq=180
ampl=(4-4*sin((pi/2/18)*animelemtime(5)))*ifelse(animelemtime(1)%2=0,1,-1)
phase=90
ignorehitpause=1



;飛び道具
[state ]
type=varset
trigger1=animelemtime(5)>=0&&animelemtime(5)<=17
trigger1=animelemtime(5)%2=0
trigger1=prevstateno!=311
var(1)=27+animelemtime(5)
ignorehitpause=1
[state ]
type=varset
trigger1=animelemtime(5)>=0&&animelemtime(5)<=9
trigger1=animelemtime(5)%2=1
trigger1=prevstateno!=311
var(1)=36+1-floor(0.5*(animelemtime(5)-1))
ignorehitpause=1
[state ]
type=varset
triggerall=var(1)%36>=0&&var(1)%36<=9
triggerall=prevstateno!=311
trigger1=animelemtime(5)>=0&&animelemtime(5)<=17
trigger1=animelemtime(5)%2=0
trigger2=animelemtime(5)>=0&&animelemtime(5)<=9
trigger2=animelemtime(5)%2=1
var(2)=10400+var(1)%36
ignorehitpause=1
[state ]
type=varset
triggerall=var(1)%36>=10&&var(1)%36<=19
triggerall=prevstateno!=311
trigger1=animelemtime(5)>=0&&animelemtime(5)<=17
trigger1=animelemtime(5)%2=0
trigger2=animelemtime(5)>=0&&animelemtime(5)<=9
trigger2=animelemtime(5)%2=1
var(2)=70400-10+var(1)%36
ignorehitpause=1
[state ]
type=varset
triggerall=var(1)%36>=20&&var(1)%36<=29
triggerall=prevstateno!=311
trigger1=animelemtime(5)>=0&&animelemtime(5)<=17
trigger1=animelemtime(5)%2=0
trigger2=animelemtime(5)>=0&&animelemtime(5)<=9
trigger2=animelemtime(5)%2=1
var(2)=80400-20+var(1)%36
ignorehitpause=1
[state ]
type=varset
triggerall=var(1)%36>=30&&var(1)%36<=35
triggerall=prevstateno!=311
trigger1=animelemtime(5)>=0&&animelemtime(5)<=17
trigger1=animelemtime(5)%2=0
trigger2=animelemtime(5)>=0&&animelemtime(5)<=9
trigger2=animelemtime(5)%2=1
var(2)=90400-30+var(1)%36
ignorehitpause=1
[state ]
type=varset
triggerall=prevstateno!=311
trigger1=animelemtime(5)>=0&&animelemtime(5)<=17
trigger1=animelemtime(5)%2=0
trigger2=animelemtime(5)>=0&&animelemtime(5)<=9
trigger2=animelemtime(5)%2=1
var(3)=12
ignorehitpause=1
[state ]
type=varset
trigger1=animelemtime(5)>=0&&animelemtime(5)<=17
trigger1=animelemtime(5)%2=0
trigger1=prevstateno!=311
var(4)=ceil(0+80*cos(0.5*pi+(pi/18)*animelemtime(5)))-2*animelemtime(5)
ignorehitpause=1
[state ]
type=varset
trigger1=animelemtime(5)>=0&&animelemtime(5)<=17
trigger1=animelemtime(5)%2=0
trigger1=prevstateno!=311
var(5)=ceil(-70+80*sin(0.5*pi+(pi/18)*animelemtime(5)))-4*animelemtime(5)
ignorehitpause=1
[state ]
type=varset
trigger1=animelemtime(5)>=0&&animelemtime(5)<=9
trigger1=animelemtime(5)%2=1
trigger1=prevstateno!=311
var(4)=30+10
ignorehitpause=1
[state ]
type=varset
trigger1=animelemtime(5)>=0&&animelemtime(5)<=9
trigger1=animelemtime(5)%2=1
trigger1=prevstateno!=311
var(5)=-68
ignorehitpause=1
[state ]
type=varset
triggerall=prevstateno!=311
trigger1=animelemtime(5)>=0&&animelemtime(5)<=17
trigger1=animelemtime(5)%2=0
trigger2=animelemtime(5)>=0&&animelemtime(5)<=9
trigger2=animelemtime(5)%2=1
var(0)=0
ignorehitpause=1
[state ]
type=changestate
triggerall=prevstateno!=311
trigger1=animelemtime(5)>=0&&animelemtime(5)<=17
trigger1=animelemtime(5)%2=0
trigger2=animelemtime(5)>=0&&animelemtime(5)<=5
trigger2=animelemtime(5)%2=1
value=311
ignorehitpause=1



;帰還、する。
[state ]
type=changestate
trigger1=animtime=0
value=0
ctrl=1
persistent=256
ignorehitpause=1

[statedef 311]

[state ]
type=changestate
triggerall=(sysfvar(0)=256006.0&&sysfvar(0)!=0.0)=0
trigger1=1
value=320000
persistent=256
ignorehitpause=1
[state ]
type=changestate
triggerall=ifelse(!ishelper,0,root,palno>=1&&root,palno<=6||!ishelper(100000)&&root,palno>=7&&root,palno<=12)
trigger1=1
value=320000
persistent=256
ignorehitpause=1
[state ]
type=varset
triggerall=ifelse(!ishelper,0,ishelper(100000)&&root,palno>=7&&root,palno<=12)
trigger1=1
sysvar(0)=stateno
ignorehitpause=1

[state ]
type=changestate
trigger1=var(0)<=-1
trigger2=var(0)>=40
value=310
ignorehitpause=1



[state ]
type=projectile
trigger1=var(0)>=0&&var(0)<=19
trigger1=var(0)%10=0
projanim=40060
projhitanim=ifelse(sysvar(3)%18>=0&&sysvar(3)%18<=9,10180+sysvar(3)%18,70180-10+sysvar(3)%18)
projremanim=-1
projscale=1,1
offset=var(4)-var(0)*var(3)*cos(pi*(var(1)%36)/18),var(5)-var(0)*var(3)*sin(pi*(var(1)%36)/18)
velocity=var(3)*cos(pi*(var(1)%36)/18),var(3)*sin(pi*(var(1)%36)/18)
accel=0,0
projremove=1
projremovetime=40
projsprpriority=2147483600
projedgebound=99999
projstagebound=99999
projheightbound=-99999,99999
pausemovetime=2147483647*ifelse(!ishelper,0,root,palno>=10&&root,palno<=12)
supermovetime=2147483647*ifelse(!ishelper,0,root,palno>=10&&root,palno<=12)
attr=s,np
hitflag=mafd
guardflag=m
affectteam=e
animtype=hard
air.animtype=back
fall.animtype=back
priority=2,hit
damage=4,2
getpower=20,10
givepower=0,5
hitsound=s100,4
guardsound=s100,4
pausetime=5,10
guard.pausetime=5,10
ground.type=high
air.type=high
ground.slidetime=10
guard.slidetime=10
ground.hittime=10
air.hittime=10
guard.ctrltime=10
airguard.ctrltime=10
ground.velocity=-4
guard.velocity=-4
air.velocity=-4,-3.5
airguard.velocity=-4,-3.5
fall=0
air.fall=1
kill=1
guard.kill=0
fall.kill=1
envshake.time=10
envshake.freq=180
envshake.ampl=6
envshake.phase=0
p2stateno=302
ignorehitpause=1

[state ]
type=explod
trigger1=var(0)%2=0
anim=var(2)+0
scale=0.01*var(3),0.01*var(3)
pos=var(4),var(5)
vel=var(3)*cos(pi*(var(1)%36)/18),var(3)*sin(pi*(var(1)%36)/18)
accel=0,0
removetime=50+var(0)
bindtime=1+var(0)
sprpriority=2147483647
ontop=0
pausemovetime=2147483647*ifelse(!ishelper,0,root,palno>=10&&root,palno<=12)
supermovetime=2147483647*ifelse(!ishelper,0,root,palno>=10&&root,palno<=12)
ignorehitpause=1
[state ]
type=explod
trigger1=var(0)%2=1
anim=var(2)+10
scale=0.01*var(3),0.01*var(3)
pos=var(4),var(5)
vel=var(3)*cos(pi*(var(1)%36)/18),var(3)*sin(pi*(var(1)%36)/18)
accel=0,0
removetime=50+var(0)
bindtime=1+var(0)
sprpriority=2147483647
ontop=0
pausemovetime=2147483647*ifelse(!ishelper,0,root,palno>=10&&root,palno<=12)
supermovetime=2147483647*ifelse(!ishelper,0,root,palno>=10&&root,palno<=12)
ignorehitpause=1
[state ]
type=explod
trigger1=var(0)>=0&&var(0)<=4
anim=ifelse(sysvar(3)%18>=0&&sysvar(3)%18<=9,10190+sysvar(3)%18,70190-10+sysvar(3)%18)
scale=0.6,0.6
pos=var(4),var(5)
vel=0,0
accel=0,0
removetime=-2
sprpriority=3
ontop=0
pausemovetime=2147483647*ifelse(!ishelper,0,root,palno>=10&&root,palno<=12)
supermovetime=2147483647*ifelse(!ishelper,0,root,palno>=10&&root,palno<=12)
ignorehitpause=1
[state ]
type=explod
trigger1=var(0)>=0&&var(0)<=4
anim=10033
scale=0.6,0.6
pos=var(4),var(5)
vel=8*cos(random)*cos(sysvar(3)),5*cos(random)*sin(sysvar(3))
accel=0,0
removetime=-2
sprpriority=4
ontop=0
pausemovetime=2147483647*ifelse(!ishelper,0,root,palno>=10&&root,palno<=12)
supermovetime=2147483647*ifelse(!ishelper,0,root,palno>=10&&root,palno<=12)
ignorehitpause=1
[state ]
type=explod
trigger1=var(0)=0
anim=10310
scale=0.3,0.3
pos=var(4),var(5)
vel=0,0
accel=0,0
removetime=-2
sprpriority=2
ontop=0
pausemovetime=2147483647*ifelse(!ishelper,0,root,palno>=10&&root,palno<=12)
supermovetime=2147483647*ifelse(!ishelper,0,root,palno>=10&&root,palno<=12)
ignorehitpause=1



[state ]
type=varset
trigger1=1
sysvar(3)=random
ignorehitpause=1



;たいむ。
[state ]
type=varadd
trigger1=1
var(0)=1
ignorehitpause=1
[state ]
type=changestate
trigger1=var(0)>=1&&var(0)<=40
value=stateno
persistent=256
ignorehitpause=1