gosub karin_end
#cgmode
#label	skip
@bg_black

select sel,"C","v[O","","2","V[eBO"
if sel=0 then goto main2
if sel=1 then goto youzyo_00
if sel=2 then goto training_in
if sel=3 then goto training_mikan_02
if sel=4 then goto shooting
#if sel=0 then gosub schedule_setsumei

label	main
turn	=	0
@initialize
#goto	skip

if global(130)=1 then goto skip_prologue1
gosub youzyo_00
goto	skip_prologue2
label	skip_prologue1
select sel,"v[O","v[OȂ"
if sel=0 then gosub youzyo_00
label	skip_prologue2
global(130)=1
#
gosub schedule_setsumei

label	main2
label	skip

date_set	2007,1,14



mikan_on	=	1
karin_on	=	0
ichigo_on	=	0
hikari_on	=	0			#Ђ
shizuku_off	=	0
###########################################################
#date_set	2007,9,02			#eXgp
#karin_kadara=900
#karin_karada_max=900
#karin_atama=900
#karin_atama_max=900
#karin_kokoro=900
#karin_karada_max=900
#karin_on=1
#ichigo_on=0

#mikan_study_level=4
#mikan_work_level=4
#mikan_special_level=4
#mikan_rest_level=2
#mikan_reception_level=4
#repayment_add 200000000
#money_set	300000000,0	#fobOp
#item_on		=	1			#fobOp############
#shop_count	= 	2			#fobOp
############################################################

if GLOBAL(110)=1 then hikari_on=1


if GLOBAL(120)=1 then ITEM_GET 113

debug		=	0

if debug=1 then money_set	300000000,0	#fobOp


#C[v#################################################################
label	mainloop
item_go		= 0

label	mainloop2
@chara_init

@bgm03
@bg_itsuki_n

date_open
minimoney_close

# XPW[ȎI #####################################################
money_open

@hensai_text


if debug=1 then goto	debug_skip01			#fobOp


jB悤H


label	mainloop2_0

window_close
money_close
minimoney_open

##	clearbutton
#	# setbutton {^ԍ,X,Y,GtFNg
addbutton 5,250,100,"Parts\Schedule\select_save.png","Parts\Schedule\select_save_over.png"
addbutton 6,650,100,"Parts\Schedule\select_load.png","Parts\Schedule\select_load_over.png"
addbutton 1,250,280,"Parts\Schedule\select_schedule.png","Parts\Schedule\select_schedule_over.png"
addbutton 2,650,280,"Parts\Schedule\select_status.png","Parts\Schedule\select_status_over.png"
if item_on=1 then addbutton 3,250,460,"Parts\Schedule\select_item.png","Parts\Schedule\select_item_over.png"
if item_on=1 and item_go=0 then addbutton 4,650,460,"Parts\Schedule\select_shop.png","Parts\Schedule\select_shop_over.png"

	getbutton sel

	se	"sound\se\NCb.wav"
##	clearbutton

if sel=1 then 	goto mainloop2_skip
if sel=2 then 	goto mainloop2_status
if sel=3 then 	goto mainloop2_itemuse
if sel=4 then 	goto mainloop2_itembuy
if sel=5 then	savesystem
if sel=6 then 	loadsystem

goto	mainloop2_0

#Xe[^X݂1 #######
label	mainloop2_status

minimoney_close
date_close
layerLoad	60,"Parts\Schedule\select_who.png"
layerPosition	60,240,-128
layerMove	60,1000/15,240,64
waitms	500

@character_select
layerMove	60,500/15,240,-128
waitms	500
layerRelease	60
date_open

#if sel=0 then goto	mainloop2_0
if sel=1 then gosub 	mainloop2_status_mikan
if sel=2 then gosub	mainloop2_status_ichigo
if sel=3 then gosub	mainloop2_status_karin

@bg_itsuki_n
goto	mainloop2_0


#Xe[^X@݂###########################################################
label	mainloop2_status_mikan
#@bg_black
@status_open_mikan
keywait
@status_close_mikan
#@bg_black
goto	mainloop2_status

#Xe[^X@###########################################################
label	mainloop2_status_ichigo
#@bg_black
@status_open_ichigo
keywait
@status_close_ichigo
#@bg_black
goto	mainloop2_status

#Xe[^X@###########################################################
label	mainloop2_status_karin
#@bg_black
@status_open_karin
keywait
@status_close_karin
#@bg_black
goto	mainloop2_status





label	mainloop2_itemuse
# ACeg #############################################################
gosub	item_use
goto	mainloop2_0

# ACe𔃂 #############################################################
label	mainloop2_itembuy
@bg_black
item_go=1
gosub	shop
if _ITEM(500)=1 and suika_item_flag2=0 then gosub suika_05

goto	mainloop2


# XPW[ ##############################################################
label	mainloop2_skip
minimoney_close




money_open



if mikan_on=0 then goto schedule_mikan_skip

#݂̃XPW[ݒ######################################################
T݂̂̃XPW[߂邩

window_close
@mikan_set
@mikan_plate_open
@lifebar_fullopen

voice	"A02524"
schedule	mikan_study_level,mikan_work_level,mikan_reception_level,mikan_rest_level,mikan_special_level
#݂̃XPW[Ҕ
for j=0 to 4
	_mikan_command(j)=_schedule_command(j)
next
@mikan_plate_close
@lifebar_fullclose
waitms	500
label	schedule_mikan_skip
if ichigo_on=0 then goto schedule_ichigo_skip

#̃XPW[ݒ#####################################################
T̂̃XPW[߂邩

window_close
@ichigo_set
@ichigo_plate_open
@lifebar_fullopen

voice	"O03710"
schedule	ichigo_study_level,ichigo_work_level,ichigo_reception_level,ichigo_rest_level,ichigo_special_level
#݂̃XPW[Ҕ
for j=0 to 4
	_ichigo_command(j)=_schedule_command(j)
next
@ichigo_plate_close
@lifebar_fullclose
waitms	500
label	schedule_ichigo_skip

if karin_on=0 then goto schedule_karin_skip

#̃XPW[ݒ#####################################################
T̂̃XPW[߂邩

window_close
@karin_set
@karin_plate_open
@lifebar_fullopen

voice	"P03574"
schedule	karin_study_level,karin_work_level,karin_reception_level,karin_rest_level,karin_special_level
#̃XPW[Ҕ
for j=0 to 4
	_karin_command(j)=_schedule_command(j)
next
@lifebar_fullclose
@karin_plate_close
waitms	500
label	schedule_karin_skip

label	debug_skip01






#@mikan_plate_close


#̃XPW[
#̃XPW[

money_close
date_close
@bg_black
waitms	1000

#XPW[s-------------------------------------------------------------

#
@bgm04
money_open
date_open
WindowClose
@bg_schedule
day_count=0
@initial_set

for j=0 to 4
	schedule_on=1
	date_add	1


#	gosub	dayevent2		#tŒCxgĂяo

	chara_count=mikan_on+ichigo_on+karin_on
	#layer_move	0,3500*chara_count,0,-1500,0,0,passtype_tcb
	layerPosition	0,	0,-2160+720
	layerPosition	1,	0,100
	layermove	0,300*chara_count,0,0,1
	layermove	1,300*chara_count,0,800,1
	#̃Cxg

if debug=1 then goto	debug_skip02			#fobOp

	# ݂̃XPW[s--------------------------------------------
	if mikan_on=0 then goto mikan_schedule_skip
	schedule_chara	=	1	#݂
	@mikan_plate_open
	@mikan_set				#݂̃p[^Zbg
	@lifebar_fullopen
	#waitms	500
	command = _mikan_command(j)
	gosub work
	# ݂̗̓`FbN
	gosub mikan_status_check
	#݂Gs\[h
	if mikan_karada_levelup_flag>0 then gosub	mikan_karada_ep
	if mikan_kokoro_levelup_flag>0 then gosub	mikan_kokoro_ep
	if mikan_atama_levelup_flag>0 then gosub	mikan_atama_ep
	if chara_count>1 then @mikan_plate_close
	if chara_count>1 then @lifebar_fullclose
	if chara_count>1 then wait	60
	label	mikan_schedule_skip

	# ̃XPW[s--------------------------------------------
	if ichigo_on=0 then goto ichigo_schedule_skip
	schedule_chara	=	2	#
	@ichigo_plate_open
	@ichigo_set				#̃p[^Zbg
	@lifebar_fullopen
#	waitms	500
	command = _ichigo_command(j)
	gosub work
	# ̗̓`FbN
	gosub ichigo_status_check
	# Gs\[h
	if ichigo_karada_levelup_flag>0 then gosub	ichigo_karada_ep
	if ichigo_kokoro_levelup_flag>0 then gosub	ichigo_kokoro_ep
	if ichigo_atama_levelup_flag>0 then gosub	ichigo_atama_ep
	@ichigo_plate_close
	@lifebar_fullclose
	wait	60
	rand rnd,0,5
	if _ITEM(401)=1 and command=33 and rnd=0 and settai_ichigo_buruma_cnt<3 then layerFadeout	1,60,money_close,date_close,gosub settai_ichigo_buruma
	label	ichigo_schedule_skip

	# ̃XPW[s--------------------------------------------
	if karin_on=0 then goto karin_schedule_skip
	schedule_chara	=	3	#
	@karin_plate_open
	@karin_set				#̃p[^Zbg
	@lifebar_fullopen
#	waitms	500
	command = _karin_command(j)
	gosub work
	# ̗̓`FbN
	gosub karin_status_check
	# Gs\[h
	if karin_karada_levelup_flag>0 then gosub	karin_karada_ep
	if karin_kokoro_levelup_flag>0 then gosub	karin_kokoro_ep
	if karin_atama_levelup_flag>0 then gosub	karin_atama_ep
	@karin_plate_close
	@lifebar_fullclose
	wait	60
	rand rnd,0,5
	if _ITEM(400)=1 and command=33 and rnd=0 and settai_karin_bunny_cnt<3 then layerFadeout	1,60,money_close,date_close,gosub settai_karin_bunny
	label	karin_schedule_skip

label	debug_skip02			#fobOp

	if j<4 then gosub dayevent


##	transition	"",120
	gosub	hensai			#ԍσ`FbN

	schedule_on=0
	day_count=day_count+1		#T̓

next
money_close
@mikan_plate_close
@lifebar_fullclose

	gosub	dayevent		#tŒCxgĂяo


date_close
waitms	1000
date_add	1
#yj
@scene_calendar

	gosub	dayevent		#tŒCxgĂяo

#	if dayevent_flag=0 then 	#tŒCxgȂꍇ

	if _MONTH=4 and _DAY=14  then goto main_satday_skip	#C̈גȂ
	if _MONTH=12 and _DAY>=1 and route_chara=3 then goto main_satday_skip #񂨂̈ג

	if _MONTH=12 and _DAY=29 and route_chara=4 then goto main_satday_skip #Ђ肨̈ג

	if _MONTH=11 and _DAY=24 and route_chara=1 then goto main_satday_skip #݂ƐQĂג

	#
	gosub	training_in		#JnOb
	if training_chara=1 then gosub	training_mikan		#݂񒲋
	if training_chara=2 then gosub	training_ichigo		#
	if training_chara=3 then gosub	training_karin		#񒲋

	gosub	hensai			#ԍσ`FbN

	label	main_satday_skip

	date_close
	@bg_black
	date_add	1
label	main_sunday
#j ---------------------------------------------------------------------
	@scene_calendar

	gosub	dayevent		#tŒCxgĂяo
#	if dayevent_flag=0 then 	#tŒCxgȂꍇ

	gosub	hensai			#ԍσ`FbN

turn = turn + 1			#^[ǉ

goto	mainloop
