label	system
//////////////////////////////////////////////////////////////////////////////////////
// `
//////////////////////////////////////////////////////////////////////////////////////
// C
otokogi=0
c_akino=0
c_ruriha=0
c_setu=0
c_chiharu=0
c_yuriko=0
c_joe=0
c_chris=0
c_mara=0
c_dream=0 // 
c_fuan=0
yuriko_route=0
route_select=0

GLOBAL(0)=0 // 
GLOBAL(5)=1 // v[O
//GLOBAL(2)=0 // }hilotO

day=0904
day_morning=0
day_night=0
//////////////////////////////////////////////////////////////////////////////////////
// C[v
//////////////////////////////////////////////////////////////////////////////////////
label	system_loop

	// }hil`FbN
	num=0
	GETMEDALNUMBER num
	if num=21 then GLOBAL(2)=1

//@bg_black

// C`FbN
if otokogi<0 then otokogi=0
if otokogi>200 then otokogi=200
otokogi_event=0
if otokogi>=50 then otokogi_event=1
if otokogi>100 then otokogi_event=2

// 
gosub	morning

//gosub calendar_display
//if day!=0913 
calendarTime	"parts\calendar\time_am.png",0,330

// END?
if day=0924 then gosub check_festival
if day=0924 then goto jump_festival

// `FbN
gosub check_day

windowclose

@bg_black
@bg03
wait 60
@bg03n
wait 60
@bg_black

// `FbN
gosub	check_night

// `FbN
gosub	check_dream



day=day+1

goto	system_loop

//////////////////////////////////////////////////////////////////////////////////////
// `FbN
//////////////////////////////////////////////////////////////////////////////////////
label	check_day


// ߑO--------------------------------------------------------------
map_time=0
gaku_f	= 0
bett_f	= 0
shok_f	= 0
cafe_f	= 0
dais_f	= 0
mori_f	= 0
funs_f	= 0

@bgm02

cgFast	"bg\fullmap2.png"

//layerLoad 1,"bg\bg10.png"
//layerEffect	2,EFFECTTYPE_DUST,100
//label loop1
//wait	500
//layerZoom 2,200,200,200
//wait	120
//layerMove 2,200,-500,-500
//wait	120
//goto	loop1
//layerRelease 1

// `RP[X1
if day=0905 {
	addButton	0,gaku_x,gaku_y,"Chara\SD\map\unknown.png","Chara\SD\map\unknown_hi.png"
	Transition	60,""
	getbutton	sel
	
	if GLOBAL(1)=1 {

xCxgłB̃Cxg܂H

		windowclose
		addTextSelect 0,"̃Cxg"
    	addTextSelect 1,"̃CxgȂ"
    	getSelect  sel
    	if sel=1 {
			goto	check_day_skip
    	}
  	}
	
	gosub chinkocase_01
	goto	check_day_skip
}


// oii1
if day=0908 {
	addButton	0,gaku_x,gaku_y,"Chara\SD\map\unknown.png","Chara\SD\map\unknown_hi.png"
	Transition	60,""
	getbutton	sel
	
	if GLOBAL(1)=1 {

xCxgłB̃Cxg܂H

		windowclose
		addTextSelect 0,"̃Cxg"
    	addTextSelect 1,"̃CxgȂ"
    	getSelect  sel
    	if sel=1 {
			goto	check_day_skip
    	}
  	}
	
	gosub banana_01
	goto	check_day_skip
}

// oii2
if day=0912 {
	addButton	0,gaku_x,gaku_y,"Chara\SD\map\unknown.png","Chara\SD\map\unknown_hi.png"
	Transition	60,""
	getbutton	sel
	
	if GLOBAL(1)=1 {

xCxgłB̃Cxg܂H

		windowclose
		addTextSelect 0,"̃Cxg"
    	addTextSelect 1,"̃CxgȂ"
    	getSelect  sel
    	if sel=1 {
			goto	check_day_skip
    	}
  	}
	
	gosub banana_02
	goto	check_day_skip
}

// xE (̂ŖYȂ悤)
if day=0913 {
	addButton	0,ryou_x,ryou_y,"Chara\SD\map\unknown.png","Chara\SD\map\unknown_hi.png"
	Transition	60,""
	getbutton	sel
    gosub kyujitsu_0913
    route_select=sel
	return
}

// T06
//if c_akino=5 {
//	addButton	0,cafe_x,cafe_y,"Chara\SD\map\joe.png","Chara\SD\map\joe_hi.png"
//	Transition	60,""
//	getbutton	sel
//    gosub s_akino
//	goto	check_day_skip
//}

// Sq02
if c_yuriko=1 {
	addButton	0,gaku_x,gaku_y,"Chara\SD\map\unknown.png","Chara\SD\map\unknown_hi.png"
	Transition	60,""
	getbutton	sel
    gosub s_yuriko
	goto	check_day_skip
}

// Sq04
//if c_yuriko=4 {
//	addButton	0,shok_x,shok_y,"Chara\SD\map\unknown.png","Chara\SD\map\unknown_hi.png"
//	Transition	60,""
//	getbutton	sel
//    gosub s_yuriko
//    return
//}

// }bv`FbN

// T06
if c_akino=5 and map_time=0 and cafe_f<1 {
	cafe_f=cafe_f+1
	addButton	0,cafe_x,cafe_y,"Chara\SD\map\joe.png","Chara\SD\map\joe_hi.png"
}

// Sq04
if c_yuriko=4 and map_time=0 and cafe_f<1 {
	cafe_f=cafe_f+1
	addButton	4,cafe_x,cafe_y,"Chara\SD\map\joe.png","Chara\SD\map\joe_hi.png"
}

gosub m_akino
gosub m_ruriha
gosub m_setu
gosub m_chiharu
gosub m_yuriko
gosub m_joe
gosub m_chris
gosub m_mara

Transition	60,""




getbutton	sel_map

// ViI`FbN
if	sel_map=0 then gosub s_akino	// T
if	sel_map=1 then gosub s_ruriha	// ڗH
if	sel_map=2 then gosub s_setu		// 
if	sel_map=3 then gosub s_chiharu	// y
if	sel_map=4 then gosub s_yuriko	// Sq
if	sel_map=5 then gosub s_joe		// W[N
if	sel_map=6 then gosub s_chris	// 藞
if	sel_map=7 {
	gosub s_mara		// }hi
	return
}

label check_day_skip
//---------------------------------------------------------------------------------
// ߌ
map_time=1
gaku_f	= 0
bett_f	= 0
shok_f	= 0
cafe_f	= 0
dais_f	= 0
mori_f	= 0
funs_f	= 0

calendar	""
@bg_black
wait	60
gosub calendar_display
calendarTime	"parts\calendar\time_pm.png",0,330


@bgm01
cgFast	"bg\fullmap2.png"

// `RP[X2
if day=0906 {
	addButton	0,gaku_x,gaku_y,"Chara\SD\map\unknown.png","Chara\SD\map\unknown_hi.png"
	Transition	60,""
	getbutton	sel

	if GLOBAL(1)=1 {

xCxgłB̃Cxg܂H

		windowclose
		addTextSelect 0,"̃Cxg"
    	addTextSelect 1,"̃CxgȂ"
    	getSelect  sel
    	if sel=1 {
			return
    	}
  	}

	gosub chinkocase_02
	return
}

// `RP[X3
if day=0919 {
	addButton	0,gaku_x,gaku_y,"Chara\SD\map\unknown.png","Chara\SD\map\unknown_hi.png"
	Transition	60,""
	getbutton	sel

	if GLOBAL(1)=1 {

xCxgłB̃Cxg܂H

		windowclose
		addTextSelect 0,"̃Cxg"
    	addTextSelect 1,"̃CxgȂ"
    	getSelect  sel
    	if sel=1 {
			return
    	}
  	}

	gosub chinkocase_03
	return
}

// }bv`FbN
gosub m_akino
gosub m_ruriha
gosub m_setu
gosub m_chiharu
gosub m_yuriko
gosub m_joe
gosub m_chris
gosub m_mara

Transition	60,""

getbutton	sel_map

// ViI`FbN
if	sel_map=0 then gosub s_akino	// T
if	sel_map=1 then gosub s_ruriha	// ڗH
if	sel_map=2 then gosub s_setu		// 
if	sel_map=3 then gosub s_chiharu	// y
if	sel_map=4 then gosub s_yuriko	// Sq
if	sel_map=5 then gosub s_joe		// W[N
if	sel_map=6 then gosub s_chris	// 藞
if	sel_map=7 then gosub s_mara		// }hi

return

//////////////////////////////////////////////////////////////////////////////////////
// `FbN
//////////////////////////////////////////////////////////////////////////////////////
label	check_night

// xE
if day=0913 {
  gosub kyujitsu_0913b
  return
}

// T02
if c_akino=1 {
  gosub s_akino
  return
}

// T04
if c_akino=3 {
  gosub s_akino
  return
}

// T08
if c_akino=8 {
  gosub s_akino
  return
}

// T10
if c_akino=10 {
  gosub s_akino
  return
}

// ڗH02
if c_ruriha=3 and c_yuriko>1 {
  gosub s_ruriha
  return
}

// ڗH07
if c_ruriha=6 {
  gosub s_ruriha
  return
}

// ڗH07
if c_ruriha=10 {
  gosub s_ruriha
  return
}

// ڗH08b
if c_ruriha=12 {
  gosub s_ruriha
  return
}

// ڗH09b
if c_ruriha=14 {
  gosub s_ruriha
  return
}

// 05b
if c_setu=5 {
  gosub s_setu
  return
}

// 06b
if c_setu=7 {
  gosub s_setu
  return
}

// 08
if c_setu=9 {
  gosub s_setu
  return
}

// y02
if c_chiharu=1 {
  gosub s_chiharu
  return
}

// y05
if c_chiharu=4 {
  gosub s_chiharu
  return
}

// y07
if c_chiharu=6 {
  gosub s_chiharu
  return
}

// y07
if c_chiharu=8 and day>chiharu_days+1 {
  gosub s_chiharu
  return
}

// y11
if c_chiharu=10 {
  gosub s_chiharu
  return
}

// y13
if c_chiharu=12 {
  gosub s_chiharu
  return
}

// Sq03
if c_yuriko=3 {
  gosub s_yuriko
  return
}

// Sq05
if c_yuriko=6 {
  gosub s_yuriko
  return
}

// 藞02
if c_chris=2 {
  gosub s_chris //
  return
}

// 藞03
if c_chris=3 {
  gosub s_chris // 3
  return
}

// s`FbN1
if day>=0915 and c_fuan=0 and otokogi<=50 {
	gosub fuan_01
	c_fuan=c_fuan+1
	return
}

// s`FbN2
if day>=0920 and c_fuan=1 and otokogi<100 {
	gosub fuan_02
	c_fuan=c_fuan+1
	return
}

  // ėp
  gosub night
return

//////////////////////////////////////////////////////////////////////////////////////
// `FbN
//////////////////////////////////////////////////////////////////////////////////////
label	check_dream

	if day<0908 then return
 //   c_dream=GLOBAL(0) // 
	num=0
	GETMEDALNUMBER num

	if c_dream=0 and num>2 {
		gosub	yume_01
	}
	if c_dream=1 and num>4 {
		gosub	yume_02
	}
	if c_dream=2 and num>6 {
		gosub	yume_03
	}
	if c_dream=3 and num>8 {
		gosub	yume_04
	}
	if c_dream=4 and num>10 {
		gosub	yume_05
	}
	if c_dream=5 and num>12 {
		gosub	yume_06
	}
	if c_dream=6 and num>14 {
		gosub	yume_07
	}
	if c_dream=7 and num>16 {
		gosub	yume_08
	}
	if c_dream=8 and num>18 {
		gosub	yume_09
	}
	if c_dream=9 and num>20 {
		gosub	yume_10
	}

	c_dream=c_dream+1
	GLOBAL(0)=c_dream

return



//////////////////////////////////////////////////////////////////////////////////////
// Ղ`FbN
//////////////////////////////////////////////////////////////////////////////////////
label	check_festival

check_akino=0
check_ruriha=0
check_setu=0
check_chiharu=0
check_mara=0

route_fix=0

otokogi_event=0
if otokogi>100 then otokogi_event=1
if otokogi>=140 then otokogi_event=2

if c_akino>10 then check_akino=1
if c_ruriha>15 then check_ruriha=1
if c_setu>11 then check_setu=1
if c_chiharu>12 then check_chiharu=1
if c_mara>9 and GLOBAL(2)=1 then check_mara=1

if yuriko_route=1 and check_akino+check_setu+check_chiharu+check_ruriha+check_mara>0 {
  route_fix=6 // Sqobh
  return
}

// obhGh
if check_akino+check_setu+check_chiharu+check_ruriha+check_mara=0 {
  route_fix=5 // obhGh
  return
}

// m[}Gh
if check_akino+check_setu+check_chiharu+check_ruriha+check_mara>0 and Otokogi<100 {
  route_fix=7 // m[}Gh
  return
}


if check_akino+check_ruriha+check_setu+check_chiharu+check_mara>1 {
  if route_select=0 and check_akino=1 then route_fix=0 // T
  if route_select=1 and check_setu=1 then route_fix=1 // 
  if route_select=2 and check_chiharu=1 then route_fix=2 // y
  if route_select=3 and check_ruriha=1 then route_fix=3 // ڗH
  if route_select=4 and check_mara=1 then route_fix=4 // }hi
  return
}

if check_akino=1 then route_fix=0 // T
if check_setu=1 then route_fix=1 // 
if check_chiharu=1 then route_fix=2 // y
if check_ruriha=1 then route_fix=3 // ڗH
if check_mara=1 then route_fix=4 // }hi

return
//////////////////////////////////////////////////////////////////////////////////////
// ՂWv
//////////////////////////////////////////////////////////////////////////////////////
label	jump_festival
if route_fix=0 {
goto megami_akino // T
}
if route_fix=1 {
goto megami_setu // 
}
if route_fix=2 {
goto megami_tiharu // y
}
if route_fix=3 {
goto megami_ruriha // ڗH
}
if route_fix=4 {
goto megami_mara // }hi
}
// obhGh
if route_fix=5 {
gosub map_badend
goto	map_badend01
}

if route_fix=6 {
gosub yuriko_07
gosub map_badend
goto yuriko_08
}

// m[}Gh
if route_fix=7 {
goto map_normalend
}

goto	jump_festival

return



//////////////////////////////////////////////////////////////////////////////////////
// T }bv
//////////////////////////////////////////////////////////////////////////////////////
label	m_akino
mx=0,my=0

if day=0904 then return
if day=0905 then return
if day=0906 then return
//if day=0908 then return
//if day=0910 then return
//if day=0912 then return
//if day=0914 then return
//if day=0916 then return
//if day=0918 then return
//if day=0920 then return

if c_akino=0 and map_time=1 and gaku_f<2 then mx=gaku_x, my=gaku_y, gaku_f=gaku_f+1
// 1 lE
if c_akino=2 and map_time=1 and gaku_f<2 then mx=gaku_x, my=gaku_y, gaku_f=gaku_f+1
// 3 HE
if c_akino=4 and map_time=1 and gaku_f<2 then mx=gaku_x, my=gaku_y, gaku_f=gaku_f+1
// 5 JtF@ɔ@W[N
if c_akino=6 and map_time=1 and gaku_f<2 then mx=gaku_x, my=gaku_y, gaku_f=gaku_f+1,akino_day=day
if c_akino=7 and map_time=1 and gaku_f<2 and akino_day+2<day then mx=gaku_x, my=gaku_y, gaku_f=gaku_f+1
// 8 EɂĎ
if c_akino=9 and map_time=1 and mori_f<1 then mx=mori_x, my=mori_y, gaku_f=mori_f+1
// 10 ET̕ɂĎ

if mx=0 and my=0 then return

addButton	0,mx,my,"Chara\SD\map\akino.png","Chara\SD\map\akino_hi.png"


return

//////////////////////////////////////////////////////////////////////////////////////
// T ViI
//////////////////////////////////////////////////////////////////////////////////////
label	s_akino

if c_akino<GLOBAL(11) and GLOBAL(1)=1 {

xCxgłB̃Cxg܂H

windowclose
addTextSelect 0,"̃Cxg"
addTextSelect 1,"̃CxgȂ"
getSelect  sel
  if sel=1 {
    c_akino = c_akino+1
    return
  }
}

if c_akino=0 then gosub akino_01
if c_akino=1 then gosub akino_02
if c_akino=2 then gosub akino_03
if c_akino=3 then gosub akino_04
if c_akino=4 then gosub akino_05
if c_akino=5 then gosub akino_06
if c_akino=6 {
  sel=0
  gosub akino_07
  if sel=0 then c_akino=8,return // rfȈꍇ
}
if c_akino=7 then gosub akino_07_03
if c_akino=8 then gosub akino_08
if c_akino=9 then gosub akino_09
if c_akino=10 then gosub akino_10

c_akino = c_akino+1
if c_akino>GLOBAL(11) then GLOBAL(11)=c_akino

return

//////////////////////////////////////////////////////////////////////////////////////
// ڗH }bv
//////////////////////////////////////////////////////////////////////////////////////
label	m_ruriha
mx=0,my=0
//if day=0904 then return
if day=0905 then return

//if day<0908 then return
//if day=0908 then return
//if day=0910 then return
//if day=0912 then return
//if day=0914 then return
//if day=0916 then return
//if day=0918 then return
//if day=0920 then return

if c_ruriha=0 and map_time=1 and gaku_f<2 then mx=gaku_x, my=gaku_y, gaku_f=gaku_f+1
if c_ruriha=1 and map_time=0 and gaku_f<2 then mx=gaku_x, my=gaku_y, gaku_f=gaku_f+1
if c_ruriha=2 and map_time=0 and gaku_f<2 then mx=gaku_x, my=gaku_y, gaku_f=gaku_f+1
// 3  锭E嗁
if c_ruriha=4 and map_time=0 and gaku_f<2 then mx=gaku_x, my=gaku_y, gaku_f=gaku_f+1
if c_ruriha=5 and map_time=0 and gaku_f<2 then mx=gaku_x, my=gaku_y, gaku_f=gaku_f+1
// 6 NCỸGs\[h 
if c_ruriha=7 and map_time=0 and gaku_f<2 then mx=gaku_x, my=gaku_y, gaku_f=gaku_f+1
if c_ruriha=8 and map_time=0 and gaku_f<2 then mx=gaku_x, my=gaku_y, gaku_f=gaku_f+1
if c_ruriha=9 and map_time=0 and funs_f<1 then mx=funs_x, my=funs_y, funs_f=funs_f+1
// 10 锭E
if c_ruriha=11 and map_time=0 and funs_f<1 then mx=funs_x, my=funs_y, funs_f=funs_f+1
// 12 锭E
if c_ruriha=13 and map_time=0 and cafe_f<1 then mx=cafe_x, my=cafe_y, cafe_f=cafe_f+1
// 14 锭
if c_ruriha=15 and map_time=0 and mori_f<1 then mx=mori_x, my=mori_y, mori_f=mori_f+1

if mx=0 and my=0 then return
addButton	1,mx,my,"Chara\SD\map\ruriha.png","Chara\SD\map\ruriha_hi.png"

return

//////////////////////////////////////////////////////////////////////////////////////
// ڗH ViI
//////////////////////////////////////////////////////////////////////////////////////
label	s_ruriha

if c_ruriha<GLOBAL(12) and GLOBAL(1)=1 {

xCxgłB̃Cxg܂H

  windowclose
  addTextSelect 0,"̃Cxg"
  addTextSelect 1,"̃CxgȂ"
  getSelect  sel
  if sel=1 {
    c_ruriha = c_ruriha+1
    return
  }
}

if c_ruriha=0 then gosub ruriha_01
if c_ruriha=1 then gosub ruriha_01_01
if c_ruriha=2 then gosub ruriha_01_02
if c_ruriha=3 then gosub ruriha_02
if c_ruriha=4 then gosub ruriha_03
if c_ruriha=5 {
	r04_quiz=0
	gosub ruriha_04
	if r04_quiz>0 then c_ruriha=8,return
}
if c_ruriha=6 then gosub ruriha_04b
if c_ruriha=7 then gosub ruriha_05
if c_ruriha=8 then gosub ruriha_06
if c_ruriha=9 then gosub ruriha_07
if c_ruriha=10 then gosub ruriha_07b
if c_ruriha=11 then gosub ruriha_08
if c_ruriha=12 then gosub ruriha_08b
if c_ruriha=13 then gosub ruriha_09
if c_ruriha=14 then gosub ruriha_09b
if c_ruriha=15 then gosub ruriha_10

c_ruriha = c_ruriha+1
if c_ruriha>GLOBAL(12) then GLOBAL(12)=c_ruriha

return

//////////////////////////////////////////////////////////////////////////////////////
//  }bv
//////////////////////////////////////////////////////////////////////////////////////
label	m_setu
mx=0,my=0
if day=0905 then return

if c_setu=0 and map_time=1 and bett_f<1 then mx=bett_x, my=bett_y, bett_f=bett_f+1		// ʓ
if c_setu=1 and map_time=0 and cafe_f<1 then mx=cafe_x, my=cafe_y, cafe_f=cafe_f+1		// JtF
if c_setu=2 and map_time=0 and bett_f<1 then mx=bett_x, my=bett_y, bett_f=bett_f+1		// ʓ
if c_setu=3 and map_time=0 and shok_f<1 then mx=shok_x, my=shok_y, shok_f=shok_f+1		// A
if c_setu=4 and map_time=0 and bett_f<1 then mx=bett_x, my=bett_y, bett_f=bett_f+1, setu_days=day	// ʓ
// 5 E
if c_setu=6 and map_time=0 and bett_f<1 and day>setu_days+2 then mx=bett_x, my=bett_y, bett_f=bett_f+1	// ʓ
// 7 E
if c_setu=8 and map_time=0 and bett_f<1 then mx=bett_x, my=bett_y, bett_f=bett_f+1	// ʓ
// 9 Ew@Ŏ
if c_setu=10 and map_time=0 and gaku_f<2 then mx=gaku_x, my=gaku_y, gaku_f=gaku_f+1	// w
if c_setu=11 and map_time=0 and dais_f<1 and otokogi>40 then mx=dais_x, my=dais_y, dais_f=dais_f+1	// 吹ɂ͂ȂBŏIIɂ͐X

if mx=0 and my=0 then return
addButton	2,mx,my,"Chara\SD\map\setu.png","Chara\SD\map\setu_hi.png"

return

//////////////////////////////////////////////////////////////////////////////////////
//  ViI
//////////////////////////////////////////////////////////////////////////////////////
label	s_setu

if c_setu<GLOBAL(13) and GLOBAL(1)=1 {

xCxgłB̃Cxg܂H

  windowclose
  addTextSelect 0,"̃Cxg"
  addTextSelect 1,"̃CxgȂ"
  getSelect  sel
  if sel=1 {
    c_setu = c_setu+1
    return
  }
}

if c_setu=0 then gosub setu_01
if c_setu=1 then gosub setu_02
if c_setu=2 then gosub setu_03
if c_setu=3 then gosub setu_04
if c_setu=4 then gosub setu_05
if c_setu=5 then gosub setu_05b
if c_setu=6 then gosub setu_06
if c_setu=7 then gosub setu_06b
if c_setu=8 then gosub setu_07
if c_setu=9 then gosub setu_08
if c_setu=10 then gosub setu_09
if c_setu=11 then gosub setu_10

c_setu = c_setu+1
if c_setu>GLOBAL(13) then GLOBAL(13)=c_setu

return

//////////////////////////////////////////////////////////////////////////////////////
// y }bv
//////////////////////////////////////////////////////////////////////////////////////
label	m_chiharu
mx=0,my=0
if day=0905 then return
//if map_time=1 then return // ߌ͔Ȃ

if c_chiharu=0 and gaku_f<1 and map_time=0 then mx=gaku_x, my=gaku_y, gaku_f=gaku_f+1	// w@
// 1 E̕Ŏ
if c_chiharu=2 and gaku_f<2 and map_time=1 {
	mx=gaku_x, my=gaku_y, gaku_f=gaku_f+1	// w@
}
if c_chiharu=3 and dais_f<1 and map_time=0 then mx=dais_x, my=dais_y, dais_f=dais_f+1	// 吹
// 4 E嗁ꎩ
if c_chiharu=5 and funs_f<1 and map_time=0 then mx=funs_x, my=funs_y, funs_f=funs_f+1	// L
// 6 E
if c_chiharu=7 and cafe_f<1 and map_time=0  then mx=cafe_x, my=cafe_y, cafe_f=cafe_f+1,chiharu_days=days	// JtF
// 8 Ɏ->tiharu_07b 
if c_chiharu=9 and gaku_f<2 and map_time=0 {
	mx=gaku_x, my=gaku_y, gaku_f=gaku_f+1	// w@
}
// 10 E
if c_chiharu=11 and gaku_f<2 and map_time=0 {
	mx=gaku_x, my=gaku_y, gaku_f=gaku_f+1	// w@ẼCxgAA
}
// 12 E



if mx=0 and my=0 then return
addButton	3,mx,my,"Chara\SD\map\chiharu.png","Chara\SD\map\chiharu_hi.png"

return

//////////////////////////////////////////////////////////////////////////////////////
// y ViI
//////////////////////////////////////////////////////////////////////////////////////
label	s_chiharu



if c_chiharu<GLOBAL(14) and GLOBAL(1)=1 {

xCxgłB̃Cxg܂H

  windowclose
  addTextSelect 0,"̃Cxg"
  addTextSelect 1,"̃CxgȂ"
  getSelect  sel
  if sel=1 {
    c_chiharu = c_chiharu+1
    return
  }
}

if c_chiharu=0 then gosub tiharu_01
if c_chiharu=1 then gosub tiharu_02
if c_chiharu=2 then gosub tiharu_03
if c_chiharu=3 then gosub tiharu_04
if c_chiharu=4 then gosub tiharu_05
if c_chiharu=5 then gosub tiharu_06
if c_chiharu=6 then gosub tiharu_06b
if c_chiharu=7 then gosub tiharu_07
if c_chiharu=8 then gosub tiharu_07b
if c_chiharu=9 then gosub tiharu_08
if c_chiharu=10 then gosub tiharu_08b
if c_chiharu=11 then gosub tiharu_09
if c_chiharu=12 then gosub tiharu_09b

c_chiharu = c_chiharu+1
if c_chiharu>GLOBAL(14) then GLOBAL(14)=c_chiharu

return

//////////////////////////////////////////////////////////////////////////////////////
// Sq }bv
//////////////////////////////////////////////////////////////////////////////////////
label	m_yuriko
mx=0,my=0
if yuriko_route=1 then return // Sq[gȊIIł
if day<0906 then return // 0910O͔Ȃ

if c_yuriko=0 and map_time=0 and shok_f<1 then mx=shok_x, my=shok_y, shok_f=shok_f+1	// A
// 1 ɋ
if c_yuriko=2 and map_time=1 and shok_f<1 then mx=shok_x, my=shok_y, shok_f=shok_f+1	// A
// 3 Ɏ@ނɓdb
// 4 ɋAW[NViI
if c_yuriko=5 and map_time=1 and cafe_f<1 then mx=cafe_x, my=cafe_y, shok_f=cafe_f+1	// A
// 6 ɎEIŃ[gI邩ς

if mx=0 and my=0 then return
addButton	4,mx,my,"Chara\SD\map\yuriko.png","Chara\SD\map\yuriko_hi.png"

return

//////////////////////////////////////////////////////////////////////////////////////
// Sq ViI
//////////////////////////////////////////////////////////////////////////////////////
label	s_yuriko

if c_yuriko<GLOBAL(15) and GLOBAL(1)=1 {

xCxgłB̃Cxg܂H

  windowclose
  addTextSelect 0,"̃Cxg"
  addTextSelect 1,"̃CxgȂ"
  getSelect  sel
  if sel=1 {
    c_yuriko = c_yuriko+1
    return
  }
}


if c_yuriko=0 then gosub yuriko_01
if c_yuriko=1 then gosub yuriko_02
if c_yuriko=2 then gosub yuriko_03
if c_yuriko=3 then gosub yuriko_03b
if c_yuriko=4 then gosub yuriko_04
if c_yuriko=5 then gosub yuriko_05
if c_yuriko=6 then gosub yuriko_06
if c_yuriko=7 then gosub yuriko_07
if c_yuriko=8 then gosub yuriko_08

c_yuriko = c_yuriko+1
if c_yuriko>GLOBAL(15) then GLOBAL(15)=c_yuriko

return

//////////////////////////////////////////////////////////////////////////////////////
// W[ }bv
//////////////////////////////////////////////////////////////////////////////////////
label	m_joe
mx=0,my=0



if c_joe=0 and map_time=1 and day=0905 and cafe_f<1 then mx=cafe_x, my=cafe_y, cafe_f=cafe_f+1		// JtF
if c_joe=1 and map_time=1 and day>0907 and cafe_f<1 then mx=cafe_x, my=cafe_y, cafe_f=cafe_f+1		// JtF
if c_joe=2 and map_time=1 and day>0911 and cafe_f<1 then mx=cafe_x, my=cafe_y, cafe_f=cafe_f+1		// JtF
if c_joe=3 and map_time=1 and day>0915 and cafe_f<1 then mx=cafe_x, my=cafe_y, cafe_f=cafe_f+1		// JtF
//if c_joe=4 and map_time=1 and day>0917 and cafe_f<1 then mx=cafe_x, my=cafe_y, cafe_f=cafe_f+1		// JtF

if mx=0 and my=0 then return
addButton	5,mx,my,"Chara\SD\map\joe.png","Chara\SD\map\joe_hi.png"

return

//////////////////////////////////////////////////////////////////////////////////////
// W[ ViI
//////////////////////////////////////////////////////////////////////////////////////
label	s_joe

if c_joe<GLOBAL(16) and GLOBAL(1)=1 {

xCxgłB̃Cxg܂H

  windowclose
  addTextSelect 0,"̃Cxg"
  addTextSelect 1,"̃CxgȂ"
  getSelect  sel
  if sel=1 {
    c_joe = c_joe+1
    return
  }
}

if c_joe=0 then gosub joe_kun
if c_joe=1 then gosub joe_01
if c_joe=2 then gosub joe_02
if c_joe=3 then gosub joe_03
//if c_joe=4 then gosub joe_04

c_joe = c_joe + 1
if c_joe>GLOBAL(16) then GLOBAL(16)=c_joe
return

//////////////////////////////////////////////////////////////////////////////////////
// 藞 }bv
//////////////////////////////////////////////////////////////////////////////////////
label	m_chris
mx=0,my=0
//if map_time=1 then return

if day<0906 then return // 0910O͔Ȃ
if c_chris=0 and dais_f<1 and map_time=0 then mx=dais_x, my=dais_y, dais_f=dais_f+1	// 吹
if c_chris=1 and dais_f<1 and c_mara>=2 and map_time=0 then mx=dais_x, my=dais_y, dais_f=dais_f+1	// 吹
// 2 HE@ }hi04oR
// 3 qE@ }hi06oR
if c_chris=4 and c_mara>7 and dais_f<1 and map_time=0 then mx=dais_x, my=dais_y, dais_f=dais_f+1	// 吹

if mx=0 and my=0 then return
addButton	6,mx,my,"Chara\SD\map\chris.png","Chara\SD\map\chris_hi.png"

return

//////////////////////////////////////////////////////////////////////////////////////
// 藞 ViI
//////////////////////////////////////////////////////////////////////////////////////
label	s_chris

if c_chris<GLOBAL(17) and GLOBAL(1)=1 {

xCxgłB̃Cxg܂H

  windowclose
  addTextSelect 0,"̃Cxg"
  addTextSelect 1,"̃CxgȂ"
  getSelect  sel
  if sel=1 {
    c_chris = c_chris+1
    return
  }
}

if c_chris=0 then gosub chris_01
if c_chris=1 then gosub chris_02
if c_chris=2 then gosub chris_03
if c_chris=3 then gosub chris_04
if c_chris=4 then gosub chris_05

c_chris = c_chris+1
if c_chris>GLOBAL(17) then GLOBAL(17)=c_chris

return

//////////////////////////////////////////////////////////////////////////////////////
// }hi }bv
//////////////////////////////////////////////////////////////////////////////////////
label	m_mara
mx=0,my=0
if day<0907 then return // 0910O͔Ȃ
if day=0919 then return // `RP[X3

if mori_f<1 then mx=mori_x, my=mori_y, mori_f=mori_f+1

if mx=0 and my=0 then return
addButton	7,mx,my,"Chara\SD\map\mara.png","Chara\SD\map\mara_hi.png"

return

//////////////////////////////////////////////////////////////////////////////////////
// }hi ViI
//////////////////////////////////////////////////////////////////////////////////////
label	s_mara

if c_mara<GLOBAL(18) and GLOBAL(1)=1 {

xCxgłB̃Cxg܂H

  windowclose
  addTextSelect 0,"̃Cxg"
  addTextSelect 1,"̃CxgȂ"
  getSelect  sel
  if sel=1 {
    if c_mara<=2 then otokogi=otokogi+10
    if c_mara>=3 then otokogi=otokogi+20
    c_mara = c_mara+1
    OtokogiLevel otokogi
    return
  }
}

if c_mara=0 then gosub mara_01
if c_mara=1 then gosub mara_02
if c_mara=2 then gosub mara_03
if c_mara=3 then gosub mara_04
if c_mara=4 then gosub mara_05
if c_mara=5 then gosub mara_06
if c_mara=6 then gosub mara_07
if c_mara=7 then gosub mara_08
if c_mara=8 then gosub mara_09
if c_mara=9 then gosub mara_10
if c_mara>9 then gosub mara_11

c_mara = c_mara+1
if c_mara>GLOBAL(18) then GLOBAL(18)=c_mara

return

//////////////////////////////////////////////////////////////////////////////////////
// v[h2-2}bv
label	map_p2a
advmenuoff
cgFast	"bg\fullmap2.png"
wait	60
addButton			0,gaku_x,gaku_y,"Chara\SD\map\ruriha.png","Chara\SD\map\ruriha_hi.png"
getButton	sel
advmenuon
return

//////////////////////////////////////////////////////////////////////////////////////
// v[h2-2}bv
label	map_p2b
advmenuoff
cgFast	"bg\fullmap2.png"
wait	60
addButton			0,dais_x,dais_y,"Chara\SD\map\chris.png","Chara\SD\map\chris_hi.png"
getButton	sel
advmenuon
return

//////////////////////////////////////////////////////////////////////////////////////
// v[h2-3}bv
label	map_p2c
advmenuoff
cgFast	"bg\fullmap2.png"
wait	60
addButton			0,mori_x,mori_y,"Chara\SD\map\akino.png","Chara\SD\map\akino_hi.png"
getButton	sel
advmenuon
return

//////////////////////////////////////////////////////////////////////////////////////
// v[h2-4}bv
label	map_p2d
advmenuoff
cgFast	"bg\fullmap2.png"
wait	60
addButton			0,ryou_x,ryou_y,"Chara\SD\map\yuriko.png","Chara\SD\map\yuriko_hi.png"
getButton	sel
advmenuon
return

//////////////////////////////////////////////////////////////////////////////////////
// _AT
label	map_megami_akino
advmenuoff
cgFast	"bg\fullmap2.png"
wait	60
addButton			0,mori_x,mori_y,"Chara\SD\map\unknown.png","Chara\SD\map\unknown_hi.png"
getButton	sel
advmenuon
return

