//////////////////////////////////////////////////
// DreamProject and s_e_beat and Suginami
// 2013.10.06 『くるむ』向けにカスタマイズ
//////////////////////////////////////////////////
*ed1

[var name = "rclick_auto" data = "1"]
[autosave     allow="0"]
[setautomode allow = "0"]
[rclick allow="0"]
[var name = "rclick_auto" data = "0"]
[rp]

// パスの設定
[var name = "t.path" data = "$os_name_path + 'image/ending/ed1/'"]

// 上書き部の画像位置を事前に設定する
[lyc id="1" file="$t.path + 'ed_b1'"]
[var name = "t.li" system = "get_layer_info" id = "1" style = "map"]

// 配置場所を右端に設定
[var name = "t.left" data = "$g.screen_width - t.li.width"]

// 上記より背景画像が見える範囲を事前に計算
[var name = "t.x_1" data = "0"]
[var name = "t.x_2" data = "$t.left - 40"]	// 透過ピクセル分を加算

// 計算したので一度破棄
[lydel id = "1"]



// タイミング調整
[var name = "t.time" data = "16000"]



// BGM再生
[bgm_play file = "$os_snd_path + 'bgm/op'" loop = "0"]

// マスク画像の読み込みをする
[lyc id = "2" file = "$t.path + 'ed_mask'"]

[var name="t.i" data="1"]
[loop estimate="$t.i <= 8"]
		// 上書き部
		[lyc id="1.1" file="$t.path + 'ed_b' + t.i"]
		[lyc id="1.2" file="$t.path + 'ed_c' + t.i"]
		[lyprop id="1.2" alpha = "0"]
		[lytween id = "1.2" param = "alpha" from = "0" to = "255" msec = "500" delay = "$t.time / 2"]
		[lyprop id = "1" left = "$t.left"]
		// 背景
		[lyc id="0" file="$t.path + 'ed_a' + t.i"]
		[var name = "t.li" system = "get_layer_info" id = "0" style = "map"]
		// 偶数目と奇数目で流れる背景の方向を変更する
		[if estimate = "$(t.i % 2) != 0"]
			// 左から右に画像を移動
			[lytween param = "left" from = "$t.x_2 - t.li.width" to = "$t.x_1" msec = "$t.time + 1000" ease = "easeout_quad"]
		[else]

			// 右から左に画像を移動
			[lytween param = "left" from = "$t.x_1" to = "$t.x_2 - t.li.width" msec = "$t.time + 1000" ease = "easeout_quad"]
		[/if]
		[trans type="1" time="500" input="0"]
		// ラストフレーム
		[if estimate = "$t.i == 13"]
			[wait time="$t.time"]
		[else]
			[wait time="$t.time"]
		[/if]
		[var name="t.i" data="$t.i + 1"]
[/loop]
// ラストフレーム
[lyc id="0" file="$t.path + 'ed_last'"]
[lydel id = "1"]
[lydel id = "2"]
[trans type="1" time="500" input="0"]
[wait time = "5000"]
// 暗転
[lycolor id = "0" color = "black"]
[trans type="1" time="3000" input="0"]
[waitbgm input = "0"]
[return]

//////////////////////////////////////////////////
*ed2

[var name = "rclick_auto" data = "1"]
[autosave     allow="0"]
[setautomode     allow="0"]
[rclick allow="0"]
[var name = "rclick_auto" data = "0"]
[rp]

// パスの設定
[var name = "t.path" data = "$os_name_path + 'image/ending/ed2/'"]

// 上書き部の画像位置を事前に設定する
[lyc id="1" file="$t.path + 'ed_b1'"]
[var name = "t.li" system = "get_layer_info" id = "1" style = "map"]

// 配置場所を右端に設定
[var name = "t.left" data = "$g.screen_width - t.li.width"]

// 上記より背景画像が見える範囲を事前に計算
[var name = "t.x_1" data = "0"]
[var name = "t.x_2" data = "$t.left - 40"]	// 透過ピクセル分を加算

// 計算したので一度破棄
[lydel id = "1"]



// タイミング調整
[var name = "t.time" data = "16000"]



// BGM再生
[bgm_play file = "$os_snd_path + 'bgm/op'" loop = "0"]

// マスク画像の読み込みをする
[lyc id = "2" file = "$t.path + 'ed_mask'"]

[var name="t.i" data="1"]
[loop estimate="$t.i <= 8"]
		// 上書き部
		[lyc id="1.1" file="$t.path + 'ed_b' + t.i"]
		[lyc id="1.2" file="$t.path + 'ed_c' + t.i"]
		[lyprop id="1.2" alpha = "0"]
		[lytween id = "1.2" param = "alpha" from = "0" to = "255" msec = "500" delay = "$t.time / 2"]
		[lyprop id = "1" left = "$t.left"]
		// 背景
		[lyc id="0" file="$t.path + 'ed_a' + t.i"]
		[var name = "t.li" system = "get_layer_info" id = "0" style = "map"]
		// 1コマ目の雨を描写
		[if estimate = "$t.i == 1"]
			[lydel id = "0"]
			[lyc id="0.1" file="$t.path + 'ed_a' + t.i"]
			[weather id = "0.2" st = "rain" arc = "-20" speed = "110" num = "128" vague = "25" flac = "0" f_speed = "0"]
		[/if]
		// 偶数目と奇数目で流れる背景の方向を変更する
		[if estimate = "$(t.i % 2) != 0"]
			// 左から右に画像を移動
			[lytween param = "left" from = "$t.x_2 - t.li.width" to = "$t.x_1" msec = "$t.time + 1000" ease = "easeout_quad"]
		[else]

			// 右から左に画像を移動
			[lytween param = "left" from = "$t.x_1" to = "$t.x_2 - t.li.width" msec = "$t.time + 1000" ease = "easeout_quad"]
		[/if]
		[trans type="1" time="500" input="0"]
		// ラストフレーム
		[if estimate = "$t.i == 13"]
			[wait time="$t.time"]
		[else]
			[wait time="$t.time"]
		[/if]
		[var name="t.i" data="$t.i + 1"]
[/loop]
// ラストフレーム
[lyc id="0" file="$t.path + 'ed_last'"]
[lydel id = "1"]
[lydel id = "2"]
[trans type="1" time="500" input="0"]
[wait time = "5000"]
// 暗転
[lycolor id = "0" color = "black"]
[trans type="1" time="3000" input="0"]
[waitbgm input = "0"]
[return]

//////////////////////////////////////////////////
*ed3

[var name = "rclick_auto" data = "1"]
[autosave     allow="0"]
[setautomode     allow="0"]
[rclick allow="0"]
[setautomode allow = "0"]
[var name = "rclick_auto" data = "0"]
[rp]

// パスの設定
[var name = "t.path" data = "$os_name_path + 'image/ending/ed3/'"]

// 上書き部の画像位置を事前に設定する
[lyc id="1" file="$t.path + 'ed_b1'"]
[var name = "t.li" system = "get_layer_info" id = "1" style = "map"]

// 配置場所を右端に設定
[var name = "t.left" data = "$g.screen_width - t.li.width"]

// 上記より背景画像が見える範囲を事前に計算
[var name = "t.x_1" data = "0"]
[var name = "t.x_2" data = "$t.left - 40"]	// 透過ピクセル分を加算

// 計算したので一度破棄
[lydel id = "1"]



// タイミング調整
[var name = "t.time" data = "16000"]



// BGM再生
[bgm_play file = "$os_snd_path + 'bgm/op'" loop = "0"]

// マスク画像の読み込みをする
[lyc id = "2" file = "$t.path + 'ed_mask'"]

[var name="t.i" data="1"]
[loop estimate="$t.i <= 8"]
		// 上書き部
		[lyc id="1.1" file="$t.path + 'ed_b' + t.i"]
		[lyc id="1.2" file="$t.path + 'ed_c' + t.i"]
		[lyprop id="1.2" alpha = "0"]
		[lytween id = "1.2" param = "alpha" from = "0" to = "255" msec = "500" delay = "$t.time / 2"]
		[lyprop id = "1" left = "$t.left"]
		// 背景
		[lyc id="0" file="$t.path + 'ed_a' + t.i"]
		[var name = "t.li" system = "get_layer_info" id = "0" style = "map"]
		// 1コマ目の雨を描写
		[if estimate = "$t.i == 1"]
			[lydel id = "0"]
			[lyc id="0.1" file="$t.path + 'ed_a' + t.i"]
			[weather id = "0.2" st = "rain" arc = "-20" speed = "110" num = "128" vague = "25" flac = "0" f_speed = "0"]
		[/if]
		// 偶数目と奇数目で流れる背景の方向を変更する
		[if estimate = "$(t.i % 2) != 0"]
			// 左から右に画像を移動
			[lytween param = "left" from = "$t.x_2 - t.li.width" to = "$t.x_1" msec = "$t.time + 1000" ease = "easeout_quad"]
		[else]

			// 右から左に画像を移動
			[lytween param = "left" from = "$t.x_1" to = "$t.x_2 - t.li.width" msec = "$t.time + 1000" ease = "easeout_quad"]
		[/if]
		[trans type="1" time="500" input="0"]
		// ラストフレーム
		[if estimate = "$t.i == 13"]
			[wait time="$t.time"]
		[else]
			[wait time="$t.time"]
		[/if]
		[var name="t.i" data="$t.i + 1"]
[/loop]
// ラストフレーム
[lyc id="0" file="$t.path + 'ed_last'"]
[lydel id = "1"]
[lydel id = "2"]
[trans type="1" time="500" input="0"]
[wait time = "5000"]
// 暗転
[lycolor id = "0" color = "black"]
[trans type="1" time="3000" input="0"]
[waitbgm input = "0"]
[return]

//////////////////////////////////////////////////
*ed4

[var name = "rclick_auto" data = "1"]
[autosave     allow="0"]
[setautomode     allow="0"]
[rclick allow="0"]
[setautomode allow = "0"]
[var name = "rclick_auto" data = "0"]
[rp]

// パスの設定
[var name = "t.path" data = "$os_name_path + 'image/ending/ed4/'"]

// 上書き部の画像位置を事前に設定する
[lyc id="1" file="$t.path + 'ed_b1'"]
[var name = "t.li" system = "get_layer_info" id = "1" style = "map"]

// 配置場所を右端に設定
[var name = "t.left" data = "$g.screen_width - t.li.width"]

// 上記より背景画像が見える範囲を事前に計算
[var name = "t.x_1" data = "0"]
[var name = "t.x_2" data = "$t.left - 40"]	// 透過ピクセル分を加算

// 計算したので一度破棄
[lydel id = "1"]



// タイミング調整
[var name = "t.time" data = "16000"]



// BGM再生
[bgm_play file = "$os_snd_path + 'bgm/op'" loop = "0"]

// マスク画像の読み込みをする
[lyc id = "2" file = "$t.path + 'ed_mask'"]

[var name="t.i" data="1"]
[loop estimate="$t.i <= 8"]
		// 上書き部
		[lyc id="1.1" file="$t.path + 'ed_b' + t.i"]
		[lyc id="1.2" file="$t.path + 'ed_c' + t.i"]
		[lyprop id="1.2" alpha = "0"]
		[lytween id = "1.2" param = "alpha" from = "0" to = "255" msec = "500" delay = "$t.time / 2"]
		[lyprop id = "1" left = "$t.left"]
		// 背景
		[lyc id="0" file="$t.path + 'ed_a' + t.i"]
		[var name = "t.li" system = "get_layer_info" id = "0" style = "map"]
		// 偶数目と奇数目で流れる背景の方向を変更する
		[if estimate = "$(t.i % 2) != 0"]
			// 左から右に画像を移動
			[lytween param = "left" from = "$t.x_2 - t.li.width" to = "$t.x_1" msec = "$t.time + 1000" ease = "easeout_quad"]
		[else]

			// 右から左に画像を移動
			[lytween param = "left" from = "$t.x_1" to = "$t.x_2 - t.li.width" msec = "$t.time + 1000" ease = "easeout_quad"]
		[/if]
		[trans type="1" time="500" input="0"]
		// ラストフレーム
		[if estimate = "$t.i == 13"]
			[wait time="$t.time"]
		[else]
			[wait time="$t.time"]
		[/if]
		[var name="t.i" data="$t.i + 1"]
[/loop]
// ラストフレーム
[lyc id="0" file="$t.path + 'ed_last'"]
[lydel id = "1"]
[lydel id = "2"]
[trans type="1" time="500" input="0"]
[wait time = "5000"]
// 暗転
[lycolor id = "0" color = "black"]
[trans type="1" time="3000" input="0"]
[waitbgm input = "0"]
[return]

//////////////////////////////////////////////////
*trial
// 体験版のエンディング？
[bgm_play file="$os_name_path + 'bgm/op_cm'" loop="1"]
[lyc id = "0" file = "$os_name_path + 'image/ending/trial/1'"]
[trans type = "1" time = "2000" input = "0"]

// しばらく強制的に見せる
[wait time = "2500" input = "0"]

*trial_info
// 何かボタンを押されたら実行
@

// SE鳴らす
[se_play id="0" file="$os_snd_path + 'se/se0000'" loop="0"]

// ブラウザでページを開かせるか否か
// url
[var name = "t.url" data = "http://kzkz.org/main/naburare/"]

// 確認ダイアログ
[var name="t.yesno" data="-1"]
[dialog title = "嬲られる店員 ～失われた清純～" message = "$'嬲られた店員のサイトでは最新情報を公開しております
ホームページ（' + t.url + '）を開いてもよろしいでしょうか'" varname = "t.yesno"]

[if estimate="$t.yesno == 1"]
	[openbrowser url="$t.url"]
	// ちょっとした演出
	[lycolor id = "10" color = "white"]
	[trans type = "1" time = "500" input = "0"]
	[lydel id = "10"]
	[trans type = "1" time = "500" input = "0"]
	// クリック待ちをする
	//@
	// SE鳴らす
	//[se_play id="0" file="$os_snd_path + 'se/se0000'" loop="0"]
	[jump label = "trial_info"]
[else]
	// なにもしない
	@
[/if]

//BGMとめる
[bgm_stop time = "1500"]

// 背景終了
[lydel id = "1"]
[lycolor id = "0" color = "black"]
[trans type = "1" time = "1500" input = "0"]


[return]
//////////////////////////////////////////////////



//////////////////////////////////////////////////
*firstpress
// 先行版のエンディング？

// 共通描画処理
[var name = "t.ed_file" data = "news_firstpress"]
[var name = "t.ed_path" data = "$os_name_path + 'image/ending/firstpress/'"]
[call label = "ed_scenario_open_common"]

// ウェイト
[wait time = "4000" input = "1"]

// 共通描画処理
[call label = "ed_scenario_close_common"]

[return]
[return]
//////////////////////////////////////////////////



//////////////////////////////////////////////////
*ed_extra_open
// エキストラモードが開封されました

// 共通描画処理
[var name = "t.ed_file" data = "news_extra"]
[var name = "t.ed_path" data = "$os_name_path + 'image/ending/other/'"]
[call label = "ed_scenario_open_common"]

// メッセージの表示 つづき
[lyc id = "11" file = "$os_name_path + 'image/ending/other/news_msg2'" economize = "1"]
// 表示位置を右下に
[var name = "t.li" system = "get_layer_info" id = "11" style = "map"]
[lyprop id = "11" left = "$g.screen_width - t.li.width - 30" top = "$g.screen_height - t.li.height - 30"]

// 描画
[trans type = "2" rule = "$os_name_path + 'rule/boyake'" vague = "32" input = "2" time = "2000" input = "0"]

// ウェイト
[wait time = "2000" input = "1"]

// 共通描画処理
[call label = "ed_scenario_close_common"]

[return]
//////////////////////////////////////////////////
*ed_scenario_open
// 新しくシナリオが追加されました

// 共通描画処理
[var name = "t.ed_file" data = "news_scenario"]
[var name = "t.ed_path" data = "$os_name_path + 'image/ending/other/'"]
[call label = "ed_scenario_open_common"]

// ウェイト
[wait time = "4000" input = "1"]

// 共通描画処理
[call label = "ed_scenario_close_common"]

[return]
//////////////////////////////////////////////////
*ed_scenario_open_extra
// 新しくシナリオが追加されました@エクストラ

// 共通描画処理
[var name = "t.ed_file" data = "news_scenario"]
[var name = "t.ed_path" data = "$os_name_path + 'image/ending/other/'"]
[call label = "ed_scenario_open_common"]

// メッセージの表示 つづき
[lyc id = "11" file = "$os_name_path + 'image/ending/other/news_msg'" economize = "1"]
// 表示位置を右下に
[var name = "t.li" system = "get_layer_info" id = "11" style = "map"]
[lyprop id = "11" left = "$g.screen_width - t.li.width - 30" top = "$g.screen_height - t.li.height - 30"]

// 描画
[trans type = "2" rule = "$os_name_path + 'rule/boyake'" vague = "32" input = "2" time = "2000" input = "0"]

// ウェイト
[wait time = "2000" input = "1"]

// 共通描画処理
[call label = "ed_scenario_close_common"]

[return]
//////////////////////////////////////////////////
*ed_scenario_open_common
// 演出１
[lycolor id = "0" color = "white"]
[lyc id = "1" file = "$t.ed_path + 'back2'" economize = "1"]
[var name = "t.li" system = "get_layer_info" id = "1" style = "map"]
[lyprop id = "1" alpha = "160"]
[lytween id = "1" param = "top" ease = "easeinout_quad" from = "0" to = "$g.screen_height - t.li.height" msec = "10000"]
[trans type = "1" time = "1000" input = "0"]

// 演出２
[lyc id = "0" file = "$t.ed_path + 'back1'" economize = "1"]
[trans type = "1" time = "1000" input = "0"]

// メッセージの表示
[lyc id = "10" file = "$t.ed_path + t.ed_file" economize = "1"]
// 表示位置をセンターに
[var name = "t.li" system = "get_layer_info" id = "10" style = "map"]
[lyprop id = "10" left = "$(g.screen_width - t.li.width) / 2" top = "$(g.screen_height - t.li.height) / 2"]

[trans type = "2" rule = "$os_name_path + 'rule/boyake'" vague = "32" input = "2" time = "2000" input = "0"]
[return]
//////////////////////////////////////////////////
*ed_scenario_close_common
// 終わり
[lycolor id = "0" color = "black"]
[lydel id = "1"]
[lydel id = "10"]
[lydel id = "11"]
[trans type = "1" time = "1500" input = "0"]
[return]
//////////////////////////////////////////////////






*last
[return]