;^Cg
@title
pageid="title"
spset "title",900
spset "command",896
spset "sign",100
spset "effect",0
sp "sign:bg",{name="img\title.png",a=255,x=0,y=0,z=1}
sp "sign:logo",{name="img\title_logo_2.png",a=255,x=20,y=1030,z=0}
sp "sign:load",{name="img\sign_load.png",a=255,x=760,y=510,z=0}
print #f,500
%n=0
for %y=1 to 6
	for %x=1 to 10
		if %y==6 and %x==2 then exit
		%s=str(%x)
		zeropad 2,%s
		sp "title:intro"+str(%y)+%s,{name={"*1,1,#00000000","img\title_intro_"+str(%y)+%s+".png"},a=255,x=0,y=0,z=1}
		%n=%n+1
		sp "sign:bar",{name=">l400,7,"+str(%n)+",51,#ff91ed,#505050",a=255,x=760,y=578,z=0}
		print #c
	next
next
spsetdelete "sign"
sp "title:bg",{name="img\title.png",a=255,x=0,y=0,z=1000}
sp "title:logo1",{name="img\title_logo_1.png",a=255,x=50,y=50,z=0}
if _mode==0 then sp "title:logo1_tr",{name="img\title_logo_1_tr.png",a=255,x=870,y=488,z=0}
sp "title:logo2",{name="img\title_logo_2.png",a=255,x=20,y=1030,z=0}
bgm "001",0,0
print #u,1000,"img\rule_00.png"
caption[1]="A young female agent caught in a trap set in cyberspace. Her avatar,\nfully connected to her physical body, is attacked by a cyber virus.\nThe virus disarms the girl through humiliating hacking."+"{@/@}"
caption[2]="Imprisoned in an underground facility as 'Test Subject El,' the girl\nis confronted by the mad scientist 'Doctor Succubus,' who orchestrated\nher abduction. In the demon's laboratory, the girl's body is hacked by\nobscene machines."+"{@/@}"
caption[3]="Doctor Succubus developed the 'Tentacle Suit.' Created through the\n'Plug- Invasion Project,' it is a horrifying bio-machine with an\ninstinct to violate females. The girl's body is lewdly trained and\ndeveloped by this monstrous sex device."+"{@/@}"
caption[4]="Secret depraved entertainments were held at the Succubus Lab. The\ndirector of the massive hospital, which also served as a cover for the\nunderground facility, personally dealt with the succubus and regularly\nvisited to 'inspect' the lab's experiments."+"{@/@}"
caption[5]="Succubus succeeded in recreating the core anomalous creatures of the\nunderground experimental facility as hybrids of inorganic and organic\nmatter. El, subjected to fusion experiments with mechanical lifeforms,\nhas her body and mind ravaged by monsters."+"{@/@}"
caption[6]="Replay of unlocked event scenes."+"{@/@}"

for %x=1 to 6
	resettimer
	lock[%x]=0
	if _mode==0 and %x>=2 and %x<=5 then lock[%x]=1
	if %x<6 and _operation_pass[%x-1][11][0]==0 then lock[%x]=1
	if %x==6 and _operation_pass[1][1][0]==0 then lock[%x]=1
	if lock[%x]==1 then
		sp "title:btn"+str(%x),{name="img\title_btn_"+str(%x)+"_lock.png",a=255,x=380+96*%x,y=550+59*%x,z=0}
	else
		sp "title:btn"+str(%x),{name={"img\title_btn_"+str(%x)+".png","img\title_btn_"+str(%x)+"_on.png"},a=255,x=380+96*%x,y=550+59*%x,z=0}
	endif
	for %i=0 to 26
		sp "command:tit"+str(%x*100+%i),{name="*"+str(62+%i*2)+","+str(108-%i*4)+",#00000000",a=255,x=406+96*%x-%i,y=550+59*%x+%i*2,z=0}
	next
	sp "title:index"+str(%x),{name={"*1,1,#00000000","img\title_index_"+str(%x)+".png"},a=255,x=472+96*%x,y=504+59*%x,z=0}
	sp "title:caption"+str(%x),{name={"*1,1,#00000000","*2000,1000,#00000000"},x=608+96*%x,y=537+59*%x,z=0}
	spformat "title:caption"+str(%x),1,caption[%x],{font="caption",x=0,y=0,w=80,h=5},{font="caption_ruby"}
	print #c
	waittimer 50
next

;VXej[Ǎ
system_menu

;{^`
@title_btndef
system_btndef
for %x=1 to 6
	for %i=0 to 26
		btn "command:tit"+str(%x*100+%i),{on="P(title:btn"+str(%x)+",1)P(title:index"+str(%x)+",1)P(title:caption"+str(%x)+",1)P(title:intro"+str(%x)+"01,1)",off="P(title:btn"+str(%x)+",0)P(title:index"+str(%x)+",0)P(title:caption"+str(%x)+",0)P(title:intro"+str(%x)+"01,0)"}
	next
next

;{^
@title_btnexec
btnid="title"
btnexec btn_title,"command",{func=1}
if mid(btn_title,0,2)=="#F" then goto "@func_"+mid(btn_title,2,2)
if btn_title=="" then goto @title_btnexec
if mid(btn_title,0,3)=="tit" then
	if lock[num(mid(btn_title,3,1))]==1 then goto @title_btnexec
endif
btnclear "command"

;VXe
if btn_title==#r then btn_title="sys4"
if mid(btn_title,0,3)=="sys" then
	system 0,num(mid(btn_title,3,1))
	goto @title_btndef
endif

se1 "013"
stage=num(mid(btn_title,3,1))
st=str(stage)

;fvXZNg
depth=1
if stage<6 then
	if _operation_pass[stage][2][0]==1 then goto @title_depth
endif

;Xe[W
@title_stage
spdeletes "title:logo"
spdeletes "title:btn"
spdeletes "title:index"
spdeletes "title:caption"
spsetdelete "command"
print #c
bgmfade 1000
wait 500

;z[h
if stage==6 then goto @log

spsetdelete "title"
backlog_format

;Ao^Cg
if depth==1 then
	pageid="avan"
	playback=0
	playback_auto=0
	orgmode=0
	diff=""
	event "avan","avan_"+st
	spsetdelete "event"
endif
goto @stage

;fvXZNg
@title_depth
for %i=2 to 9
	spvisible "command:sys"+str(%i),0
next
for %x=1 to 6
	if %x<>stage then spvisible "title:btn"+str(%x),0
next
spcell "title:caption"+st,0
for %i=1 to 10
	%s=str(%i)
	zeropad 2,%s
	if _operation_pass[stage][%i][0]==1 then
		sp "command:dep"+%s,{name={"img\depsel_btn_"+%s+".png","img\depsel_btn_"+%s+"_on.png"},a=255,x=410+96*stage+85*%i,y=550+59*stage,z=0}
		if %i==1 then
			btn "command:dep"+%s
		elseif %i>=2 then
			btn "command:dep"+%s,{on="P(title:intro"+st+"01,0)P(title:intro"+st+%s+",1)",off="P(title:intro"+st+"01,1)P(title:intro"+st+%s+",0)"}
		endif
	else
		sp "command:dep"+%s,{name="img\depsel_btn_00_lock.png",a=255,x=410+96*stage+85*%i,y=550+59*stage,z=0}
	endif
next

;{^
@depsel_btnexec
btnid="depsel"
btnexec btn_depsel,"command",{func=1}
if mid(btn_depsel,0,2)=="#F" then goto "@func_"+mid(btn_depsel,2,2)
if btn_depsel=="" then goto @depsel_btnexec
btnclear "command"
if btn_depsel==#r then
	spdeletes "command:dep"
spvisible "title:index"+st,0
	for %i=2 to 9
		spvisible "command:sys"+str(%i),1
	next
	for %x=1 to 6
		if %x<>stage then spvisible "title:btn"+str(%x),1
	next
	for %i=1 to 10
		%s=str(%i)
		zeropad 2,%s
		spcell "title:intro"+st+%s,0
	next
	spcell "title:index"+st,0
	spcell "title:btn"+st,0
	goto @title_btndef
endif

depth=num(mid(btn_depsel,3,2))
se1 "013"
goto @title_stage
