//******************************************************************************
// YAYA　ゴーストテンプレート
// 起動/終了トーク辞書
//******************************************************************************

//******************************************************************************
//初回起動 OnFirstBoot
//******************************************************************************

初回起動_原作
{
	//---- 変数の初期化
	username         = L('bootend_13')
	mikireflag       = 0	// 見切れ処理用
	tellyourname     = 0    // 名前を教えたか（最初は当然していない）
	CurrentTime		 = GETSECCOUNT() // ゴーストを起動した時間
	GhostLastBoot		 = CurrentTime // ゴーストを最後に起動した時間

	//---- Vanishカウントを見て、真の初回か否かを判定する
	if reference[0] == 0
	{
		//---- ほんとうに初めての起動
		L('bootend_23')
		--
		AYATEMPLATE.MenuItem(L('bootend_25'),"Menu_FIRSTTALK1",200)
		--
		AYATEMPLATE.MenuItem(L('bootend_27'),"Menu_FIRSTTALK2")
		--
	}
	else
	{
		//---- 再インストール後の起動
		L('bootend_33')
	}
}

Menu_FIRSTTALK1
{
	L('bootend_39')
}

Menu_FIRSTTALK2
{
	L('bootend_44')
}

//******************************************************************************
//通常の起動 OnBoot
//******************************************************************************

起動_原作
{
	CurrentTime		 = GETSECCOUNT() // ゴーストを起動した時間

	if CurrentTime - GhostLastBoot > 604800 {
		L('bootend_56')
	}
	elseif CurrentTime - GhostLastBoot < 60 {
		L('bootend_59')
	}

//ユーザー誕生日
	elseif userbirthday_date == STRFORM("$02d$02d",GETTIME[1],GETTIME[2]) {
		L('bootend_64')
	}
//電池の日
	elseif month == 11 && day == 11
	{
		L('bootend_69')
	}

//ここまで


	else	{
	//---- まず双方のサーフィスを表示
	"\0\s[0]\1\s[10]"
	--
	//---- 起動時間を確認してあいさつを変化
	_timeslot = GetTimeSlot
	
	case _timeslot{
	when "朝"
	{
		L('bootend_85')
	}
	when "昼"
	{
		L('bootend_89')
	}
	when "日中"
	{
		L('bootend_93')
	}
	when "夜"
	{
		L('bootend_97')
	}
	others
	{
		//それ以外の時間の場合
		L('bootend_102')
	}
	}//caseの終わり
	}//ifの終わり
}

//------------------------------------------------------------------------------
//朝/昼/夜などをおおざっぱに調べる関数
//------------------------------------------------------------------------------
GetTimeSlot
{
	case hour{
	when 22,23,0,1,2,3 {'深夜'}
	when 4,5,6,7,8,9,10,11 {'朝'}
	when 12,13 {'昼'}
	when 14,15,16,17 {'日中'}
	when 18,19,20,21 {'夜'}
	}//caseの終わり
}

//------------------------------------------------------------------------------
// 上旬/中旬/下旬などをおおざっぱに調べる関数
//------------------------------------------------------------------------------
GetDaySlot
{
	//10日,20日で区切りにしてみた
	_d = day
	if _d <= 10 { '上旬' }
	elseif _d <= 20 { '中旬' }
	else { '下旬' }
}

//------------------------------------------------------------------------------
// 季節をおおざっぱに調べる関数
//------------------------------------------------------------------------------
GetMonthSlot
{
	_mtime = GETTIME()
	if _mtime[1] >= 3 && _mtime[1] <= 5
	{
		'spring'
	}
	elseif _mtime[1] >= 6 && _mtime[1] <= 8
	{
		'summer'
	}
	elseif _mtime[1] >= 9 && _mtime[1] <= 11
	{
		'fall'
	}
	else
	{
		'winter'
	}
}


//******************************************************************************
//終了 OnClose
//******************************************************************************

OnClose
{
	GhostLastBoot		 = CurrentTime // ゴーストを最後に起動した時間

	"\1\s[10]"
	--
	//この部分には\eつけないでね！
	_timeslot = GetTimeSlot
	if _timeslot == "朝"
	{
		//---- 朝に終了
		L('bootend_174')
	}
	elseif _timeslot == "昼" || _timeslot == "日中"
	{
		//---- 昼/日中に終了
		L('bootend_179')
	}
	elseif _timeslot == "夜"
	{
		L('bootend_183')
	}
	else
	{
		//---- 夜/深夜に終了
		L('bootend_188')
	}
	--
	"\w9\w9\-\e"
}


//******************************************************************************
//最小化からの復帰 OnWindowStateRestore
//******************************************************************************

OnWindowStateRestore
{
	L('bootend_201')
}
