<?xml version="1.0" encoding="shift_jis"?>

<exbulletml>

<!-- *************************************************************************** -->
<!-- *****    各ステージ（１面含む）開始時に設定されるパラメータ           ***** -->
<!-- *************************************************************************** -->

<action label="stage_setting_action">
	<system><command>enablepause</command></system>
	<system><command>enablecollision</command></system>
	<system><command>fulldrawoff</command></system>
	<system><command>enableskipbutton</command></system>
		
	<!-- stage e-crystal を初期化 -->
	<system><command>resetstageecrystal</command></system>

	<!-- BUZZ を初期化 -->
	<system><command>resetbuzz</command></system>

	<!-- ステージミスカウントを初期化 -->
	<system><command>clearstagemisscount</command></system>

	<!-- ランク値を取得 -->
	<aref l="calc_rank_action_init"></aref>

	<!-- グローバル変数初期化 -->
	<global name="item_dir_01">0</global>
	<global name="prate_check">0</global>
	<global name="miss_count_temp">0</global>
	<global name="ttc_start">0</global>
	<global name="counter_tmp">0</global>
	<global name="boss_secret">0</global>
	<global name="stage_init_rank">$__grank</global>
	<global name="grank_temp">0</global>
	<global name="prate_average">0</global>
	<global name="prate_average_num">0</global>
	<global name="counter_tmp">0</global>
	<global name="timer">0</global>
	<global name="timerwait">0</global>
	<global name="boss_state">1</global>
	<global name="boss_life">1</global>
	<global name="temp_grank">$__grank</global>
	<global name="end_offset">0</global>
	<global name="end_flag">0</global>
	<global name="miss_temp">0</global>
	<global name="bg_white">0</global>

	<!-- 朝朔を静馬に変更するフラグ -->
	<global n="player_shizuma_on">0</global>
	<!-- SECRET条件用 -->
	<global name="item_count">0</global>
	<global name="m6_count">0</global>
	<!-- ショット用 -->
	<global name="temp_dir">0</global>	
	<global name="temp_dir2">0</global>
	<global name="shot_time">0</global>	
	<global name="shot_time2">0</global>	
	<global name="shot_sound">0</global>
	<!-- ショット色変更 stageIのみ最初から色が変わる -->
	<global name="shot_color">0</global>

</action>

<a l="p_avrage_add">
	<global name="prate_average">$__prate_average+$_prate</global>
	<global name="prate_average_num">$__prate_average_num+1</global>
</a>

<a l="play_rank_up">
	<repeat><times>$__miss_count_temp-eq$_stagemisscount</times>
		<addRank><num>$__rankup_base</num></addRank>
	</repeat>

	<global name="miss_count_temp">$_stagemisscount</global>	
</a>

<!-- 平均侵食率計算、ランクアップ計算 -->
<a l="set_param">
	<aref l="p_avrage_add"></aref>
	<aref l="play_rank_up"></aref>
<!--
	<debugstr><string>ecrystal2</string></debugstr>
	<debugval><num>$_ecrystal2</num></debugval>
-->
</a>
<!-- create Shot_break -->
<action label="shot_break_action">

	<global name="shot_sound">$__shot_sound+1</global>
	<repeat><times>$__shot_sound-gt1000000</times>
		<global name="shot_sound">0</global>
	</repeat>

</action>

<create label="shot_break_sound">

	<speed>0</speed>
	<direction type="absolute">0</direction>
	<cx>1</cx><cy>1</cy>
	<object label="shot_break_obj">
		<action>
			<eval name="temp_shot">$__shot_sound</eval>
			<repeat><times>-1</times>
				<repeat><times>1-($temp_shot-eq$__shot_sound)</times>
					<soundtrack><file type="ogg">shot_break</file></soundtrack>	
				</repeat>
				<eval name="temp_shot">$__shot_sound</eval>
				<w>6</w>
			</repeat>
		</action>
	</object>

</create>

<create label="shot_break_sound2">

	<speed>0</speed>
	<direction type="absolute">0</direction>
	<cx>1</cx><cy>1</cy>
	<object label="shot_break_obj">
		<action>
			<eval name="temp_shot">$__shot_sound</eval>
			<repeat><times>-1</times>
				<repeat><times>1-($temp_shot-eq$__shot_sound)</times>
					<soundtrack><file type="ogg">shot_break1</file></soundtrack>	
				</repeat>
				<eval name="temp_shot">$__shot_sound</eval>
				<w>6</w>
			</repeat>
		</action>
	</object>

</create>


<!-- *****    A 面開始時に設定されるパラメータ                             ***** -->
<action label="stageA_setting_action">
	<sysvar name="stagenum">1</sysvar>
	<sysvar name="stageflag">0</sysvar>

	<global name="e_crystal">-78</global>
	<global name="e_crystal_ttc">-9</global>
	<global name="e_crystal_boss">-100</global>
	<global name="e_crystal_score_ttc">(40+20*1)*($_difficulty+1)</global>
	<global name="e_crystal_score">(450+150*1)*($_difficulty+1)</global>
	<global name="e_crystal_rank">5+$_difficulty*8</global>
	<global name="e_crystal_rank_ttc">1+$_difficulty*1</global>
	<global name="rankup_base">400+($_difficulty*500)</global>
	<global name="magic_rank_down">-2500</global>
	<global name="twins_set">2</global>
	<global name="lowpratebonus">400000</global>
	
	<!-- プレイヤー速度が設定されるまで動かさない -->
	<system><command>playermovedisable</command></system>
	<system><command>startreplay</command></system>
	<wait>3</wait>
		
</action>

<!-- *****    B 面開始時に設定されるパラメータ                             ***** -->
<action label="stageB_setting_action">
	<sysvar name="stagenum">2</sysvar>
	<sysvar name="stageflag">0</sysvar>

	<global name="e_crystal">-69</global>
	<global name="e_crystal_ttc">-8</global>
	<global name="e_crystal_boss">-91</global>
	<global name="e_crystal_score_ttc">(40+20*2)*($_difficulty+1)</global>
	<global name="e_crystal_score">(450+150*2)*($_difficulty+1)</global>
	<global name="e_crystal_rank">3+$_difficulty*8</global>
	<global name="e_crystal_rank_ttc">1+$_difficulty*1</global>
	<global name="rankup_base">400+($_difficulty*550)</global>
	<global name="magic_rank_down">-2500</global>
	<global name="twins_set">2</global>
	<global name="lowpratebonus">320000</global>

	<global name="maho_move">0</global>

	<!-- プレイヤー速度が設定されるまで動かさない -->
	<system><command>playermovedisable</command></system>
	<system><command>startreplay</command></system>
	<wait>3</wait>
		
</action>

<!-- *****    C1 面開始時に設定されるパラメータ                             ***** -->
<action label="stageC1_setting_action">
	<sysvar name="stagenum">2</sysvar>
	<sysvar name="stageflag">1</sysvar>

	<global name="e_crystal">-69</global>
	<global name="e_crystal_ttc">-8</global>
	<global name="e_crystal_boss">-91</global>
	<global name="e_crystal_score_ttc">(40+20*2)*($_difficulty+1)</global>
	<global name="e_crystal_score">(500+150*2)*($_difficulty+1)</global>
	<global name="e_crystal_rank">3+$_difficulty*7</global>
	<global name="e_crystal_rank_ttc">1+$_difficulty*1</global>
	<global name="rankup_base">400+($_difficulty*600)</global>
	<global name="magic_rank_down">-2500</global>
	<global name="twins_set">2</global>
	<global name="lowpratebonus">320000</global>

	<!-- プレイヤー速度が設定されるまで動かさない -->
	<system><command>playermovedisable</command></system>
	<system><command>startreplay</command></system>
	<wait>3</wait>
		
</action>

<!-- *****    C2 面開始時に設定されるパラメータ                             ***** -->
<action label="stageC2_setting_action">
	<sysvar name="stagenum">3</sysvar>
	<sysvar name="stageflag">0</sysvar>

	<global name="e_crystal">-68</global>
	<global name="e_crystal_ttc">-7</global>
	<global name="e_crystal_boss">-88</global>
	<global name="e_crystal_score_ttc">(40+20*3)*($_difficulty+1)</global>
	<global name="e_crystal_score">(450+150*3)*($_difficulty+1)</global>
	<global name="e_crystal_rank">3+$_difficulty*6</global>
	<global name="e_crystal_rank_ttc">1+$_difficulty*1</global>
	<global name="rankup_base">500+($_difficulty*600)</global>
	<global name="magic_rank_down">-2500</global>
	<global name="twins_set">2</global>
	<global name="lowpratebonus">240000</global>

	<!-- プレイヤー速度が設定されるまで動かさない -->
	<system><command>playermovedisable</command></system>
	<system><command>startreplay</command></system>
	
	<wait>3</wait>
		
</action>

<!-- *****    D 面開始時に設定されるパラメータ                             ***** -->
<action label="stageD_setting_action">
	<sysvar name="stagenum">3</sysvar>
	<sysvar name="stageflag">1</sysvar>

	<global name="e_crystal">-66</global>
	<global name="e_crystal_ttc">-7</global>
	<global name="e_crystal_boss">-88</global>
	<global name="e_crystal_score_ttc">(40+20*3)*($_difficulty+1)</global>
	<global name="e_crystal_score">(500+150*3)*($_difficulty+1)</global>
	<global name="e_crystal_rank">3+$_difficulty*6</global>
	<global name="e_crystal_rank_ttc">1+$_difficulty*1</global>
	<global name="rankup_base">500+($_difficulty*650)</global>
	<global name="magic_rank_down">-2500</global>
	<global name="twins_set">2</global>
	<global name="lowpratebonus">240000</global>

	<!-- プレイヤー速度が設定されるまで動かさない -->
	<system><command>playermovedisable</command></system>
	<system><command>startreplay</command></system>
	
	<wait>3</wait>
		
</action>


<!-- *****    E1 面開始時に設定されるパラメータ                             ***** -->
<action label="stageE1_setting_action">
	<sysvar name="stagenum">4</sysvar>
	<sysvar name="stageflag">0</sysvar>

	<global name="e_crystal">-66</global>
	<global name="e_crystal_ttc">-7</global>
	<global name="e_crystal_boss">-88</global>
	<global name="e_crystal_score_ttc">(40+20*4)*($_difficulty+1)</global>
	<global name="e_crystal_score">(450+150*4)*($_difficulty+1)</global>
	<global name="e_crystal_rank">3+$_difficulty*6</global>
	<global name="e_crystal_rank_ttc">1+$_difficulty*1</global>
	<global name="rankup_base">550+($_difficulty*650)</global>
	<global name="magic_rank_down">-2500</global>
	<global name="twins_set">2</global>
	<global name="lowpratebonus">160000</global>

	<!-- プレイヤー速度が設定されるまで動かさない -->
	<system><command>playermovedisable</command></system>
	<system><command>startreplay</command></system>
	
	<wait>3</wait>
		
</action>

<!-- *****    E2 面開始時に設定されるパラメータ                             ***** -->
<action label="stageE2_setting_action">
	<sysvar name="stagenum">4</sysvar>
	<sysvar name="stageflag">1</sysvar>

	<global name="e_crystal">-66</global>
	<global name="e_crystal_ttc">-7</global>
	<global name="e_crystal_boss">-88</global>
	<global name="e_crystal_score_ttc">(40+20*4)*($_difficulty+1)</global>
	<global name="e_crystal_score">(500+150*4)*($_difficulty+1)</global>
	<global name="e_crystal_rank">3+$_difficulty*6</global>
	<global name="e_crystal_rank_ttc">1+$_difficulty*1</global>
	<global name="rankup_base">600+($_difficulty*650)</global>
	<global name="magic_rank_down">-2500</global>
	<global name="twins_set">2</global>
	<global name="lowpratebonus">160000</global>


	<!-- プレイヤー速度が設定されるまで動かさない -->
	<system><command>playermovedisable</command></system>
	<system><command>startreplay</command></system>
	
	<wait>3</wait>
		
</action>
<!-- *****    E3 面開始時に設定されるパラメータ                             ***** -->
<action label="stageE3_setting_action">
	<sysvar name="stagenum">4</sysvar>
	<sysvar name="stageflag">2</sysvar>

	<global name="e_crystal">-66</global>
	<global name="e_crystal_ttc">-7</global>
	<global name="e_crystal_boss">-88</global>
	<global name="e_crystal_score_ttc">(40+20*4)*($_difficulty+1)</global>
	<global name="e_crystal_score">(550+150*4)*($_difficulty+1)</global>
	<global name="e_crystal_rank">3+$_difficulty*6</global>
	<global name="e_crystal_rank_ttc">1+$_difficulty*1</global>
	<global name="rankup_base">650+($_difficulty*650)</global>
	<global name="magic_rank_down">-2500</global>
	<global name="twins_set">2</global>
	<global name="lowpratebonus">160000</global>

	<!-- プレイヤー速度が設定されるまで動かさない -->
	<system><command>playermovedisable</command></system>
	<system><command>startreplay</command></system>
	
	<wait>3</wait>
		
</action>

<!-- *****    F1 面開始時に設定されるパラメータ                             ***** -->
<action label="stageF1_setting_action">
	<sysvar name="stagenum">5</sysvar>
	<sysvar name="stageflag">0</sysvar>

	<global name="e_crystal">-63</global>
	<global name="e_crystal_ttc">-4</global>
	<global name="e_crystal_boss">-71</global>
	<global name="e_crystal_score_ttc">(40+20*5)*($_difficulty+1)</global>
	<global name="e_crystal_score">(550+150*5)*($_difficulty+1)</global>
	<global name="e_crystal_rank">3+$_difficulty*6</global>
	<global name="e_crystal_rank_ttc">1+$_difficulty*1</global>
	<global name="rankup_base">700+($_difficulty*700)</global>
	<global name="magic_rank_down">-2500</global>
	<global name="twins_set">2</global>
	<global name="lowpratebonus">120000</global>

	<!-- プレイヤー速度が設定されるまで動かさない -->
	<system><command>playermovedisable</command></system>
	<system><command>startreplay</command></system>
	
	<wait>3</wait>
		
</action>

<!-- *****    F2 面開始時に設定されるパラメータ                             ***** -->
<action label="stageF2_setting_action">
	<sysvar name="stagenum">5</sysvar>
	<sysvar name="stageflag">1</sysvar>

	<global name="e_crystal">-63</global>
	<global name="e_crystal_ttc">-4</global>
	<global name="e_crystal_boss">-71</global>
	<global name="e_crystal_score_ttc">(40+20*5)*($_difficulty+1)</global>
	<global name="e_crystal_score">(600+150*5)*($_difficulty+1)</global>
	<global name="e_crystal_rank">3+$_difficulty*6</global>
	<global name="e_crystal_rank_ttc">1+$_difficulty*1</global>
	<global name="rankup_base">750+($_difficulty*700)</global>
	<global name="magic_rank_down">-2500</global>
	<global name="twins_set">2</global>
	<global name="lowpratebonus">110000</global>


	<!-- プレイヤー速度が設定されるまで動かさない -->
	<system><command>playermovedisable</command></system>
	<system><command>startreplay</command></system>
	
	<wait>3</wait>
		
</action>

<!-- *****    F3 面開始時に設定されるパラメータ                             ***** -->
<action label="stageF3_setting_action">
	<sysvar name="stagenum">5</sysvar>
	<sysvar name="stageflag">2</sysvar>

	<global name="e_crystal">-63</global>
	<global name="e_crystal_ttc">-4</global>
	<global name="e_crystal_boss">-71</global>
	<global name="e_crystal_score_ttc">(40+20*5)*($_difficulty+1)</global>
	<global name="e_crystal_score">(650+150*5)*($_difficulty+1)</global>
	<global name="e_crystal_rank">3+$_difficulty*6</global>
	<global name="e_crystal_rank_ttc">1+$_difficulty*1</global>
	<global name="rankup_base">800+($_difficulty*700)</global>
	<global name="magic_rank_down">-2500</global>
	<global name="twins_set">2</global>
	<global name="lowpratebonus">100000</global>

	<!-- プレイヤー速度が設定されるまで動かさない -->
	<system><command>playermovedisable</command></system>
	<system><command>startreplay</command></system>
	
	<wait>3</wait>
		
</action>

<!-- *****   G1 面開始時に設定されるパラメータ                             ***** -->
<action label="stageG1_setting_action">
	<sysvar name="stagenum">6</sysvar>
	<sysvar name="stageflag">0</sysvar>

	<global name="e_crystal">-55</global>
	<global name="e_crystal_ttc">-3</global>
	<global name="e_crystal_boss">-69</global>
	<global name="e_crystal_score_ttc">(40+20*6)*($_difficulty+1)</global>
	<global name="e_crystal_score">(550+150*6)*($_difficulty+1)</global>
	<global name="e_crystal_rank">3+$_difficulty*6</global>
	<global name="e_crystal_rank_ttc">1+$_difficulty*1</global>
	<global name="rankup_base">800+($_difficulty*800)</global>
	<global name="magic_rank_down">-2500</global>
	<global name="twins_set">2</global>
	<global name="lowpratebonus">50000</global>

	<!-- プレイヤー速度が設定されるまで動かさない -->
	<system><command>playermovedisable</command></system>
	<system><command>startreplay</command></system>
	
	<wait>3</wait>
		
</action>


<!-- *****   G2 面開始時に設定されるパラメータ                             ***** -->
<action label="stageG2_setting_action">
	<sysvar name="stagenum">6</sysvar>
	<sysvar name="stageflag">1</sysvar>

	<global name="e_crystal">-54</global>
	<global name="e_crystal_ttc">-3</global>
	<global name="e_crystal_boss">-69</global>
	<global name="e_crystal_score_ttc">(40+20*6)*($_difficulty+1)</global>
	<global name="e_crystal_score">(600+150*6)*($_difficulty+1)</global>
	<global name="e_crystal_rank">3+$_difficulty*6</global>
	<global name="e_crystal_rank_ttc">1+$_difficulty*1</global>
	<global name="rankup_base">850+($_difficulty*800)</global>
	<global name="magic_rank_down">-2500</global>
	<global name="twins_set">2</global>
	<global name="lowpratebonus">50000</global>

	<!-- プレイヤー速度が設定されるまで動かさない -->
	<system><command>playermovedisable</command></system>
	<system><command>startreplay</command></system>
	
	<wait>3</wait>
		
</action>

<!-- *****   G3 面開始時に設定されるパラメータ                             ***** -->
<action label="stageG3_setting_action">
	<sysvar name="stagenum">6</sysvar>
	<sysvar name="stageflag">2</sysvar>

	<global name="e_crystal">-54</global>
	<global name="e_crystal_ttc">-3</global>
	<global name="e_crystal_boss">-69</global>
	<global name="e_crystal_score_ttc">(40+20*6)*($_difficulty+1)</global>
	<global name="e_crystal_score">(650+150*6)*($_difficulty+1)</global>
	<global name="e_crystal_rank">3+$_difficulty*6</global>
	<global name="e_crystal_rank_ttc">1+$_difficulty*1</global>
	<global name="rankup_base">900+($_difficulty*800)</global>
	<global name="magic_rank_down">-2500</global>
	<global name="twins_set">2</global>
	<global name="lowpratebonus">50000</global>

	<!-- プレイヤー速度が設定されるまで動かさない -->
	<system><command>playermovedisable</command></system>
	<system><command>startreplay</command></system>
	
	<wait>3</wait>
		
</action>


<!-- *****   H 面開始時に設定されるパラメータ                             ***** -->
<action label="stageH_setting_action">
	<sysvar name="stagenum">7</sysvar>
	<sysvar name="stageflag">0</sysvar>

	<global name="e_crystal">-54</global>
	<global name="e_crystal_ttc">-3</global>
	<global name="e_crystal_boss">-69</global>
	<global name="e_crystal_score_ttc">(40+20*7)*($_difficulty+1)</global>
	<global name="e_crystal_score">1600*($_difficulty+1)</global>
	<global name="e_crystal_rank">15+$_difficulty*3</global>
	<global name="e_crystal_rank_ttc">3+$_difficulty*1</global>
	<global name="rankup_base">1000+($_difficulty)*1300</global>
	<global name="magic_rank_down">-10000</global>
	<global name="twins_set">2</global>
	<global name="lowpratebonus">50000</global>

	<!-- プレイヤー速度が設定されるまで動かさない -->
	<system><command>playermovedisable</command></system>
	<system><command>startreplay</command></system>
	
	<wait>3</wait>
		
</action>


<!-- *****    I 面開始時に設定されるパラメータ                             ***** -->
<action label="stageI_setting_action">
	<sysvar name="stagenum">7</sysvar>
	<sysvar name="stageflag">1</sysvar>

	<global name="e_crystal">-54</global>
	<global name="e_crystal_ttc">-3</global>
	<global name="e_crystal_boss">-69</global>
	<global name="e_crystal_score_ttc">(60+20*7)*($_difficulty+1)</global>
	<global name="e_crystal_score">1850*($_difficulty+1)</global>
	<global name="e_crystal_rank">16+$_difficulty*3</global>
	<global name="e_crystal_rank_ttc">3+$_difficulty*1</global>
	<global name="rankup_base">1800+($_difficulty)*1300</global>
	<global name="magic_rank_down">-10000</global>
	<global name="twins_set">2</global>
	<global name="lowpratebonus">50000</global>

	<!-- プレイヤー速度が設定されるまで動かさない -->
	<system><command>playermovedisable</command></system>
	<system><command>startreplay</command></system>
	
	<wait>3</wait>
		
</action>


<!-- *****    EXTRA 面開始時に設定されるパラメータ                             ***** -->
<action label="stageEX_setting_action">
	<sysvar name="stagenum">9</sysvar>
	<sysvar name="stageflag">0</sysvar>

	<global name="e_crystal">-81</global>
	<global name="e_crystal_ttc">-4</global>
	<global name="e_crystal_boss">-96</global>
	<global name="e_crystal_score_ttc">530</global>
	<global name="e_crystal_score">6170</global>
	<global name="e_crystal_rank">19</global>
	<global name="e_crystal_rank_ttc">4</global>
	<global name="rankup_base">4600</global>
	<global name="magic_rank_down">-10000</global>
	<global name="twins_set">2</global>
	<global name="lowpratebonus">200000</global>
	<global name="lowprate_saki2">500000</global>

	<!-- プレイヤー速度が設定されるまで動かさない -->
	<system><command>playermovedisable</command></system>
	<system><command>startreplay</command></system>
	
	<wait>3</wait>
		
</action>

</exbulletml>
