<?xml version="1.0" encoding="shift-jis"?>
<exbulletml>

<!-- ********************************************************************* -->
<!-- *** 中ボス戦                                                      *** -->
<!-- ***                                                               *** -->

<action label="stage_middle_boss_action">

	<!-- *** 第 N 形態 *** -->
	<global name="boss_state">1</global>

	<!-- BOSS SECRET DEBUG用 -->
<!--	<global name="boss_secret">1</global> -->
	
	<!-- *** ボスの初期ライフ *** -->
	<global name="boss_life">1</global>

	<!-- *** 最初のボスオブジェクト作成 *** -->
	<!-- ｘ座標、y座標、体力、inv、スコア、侵食率 -->
	<createRef label="enemy_create_middle_boss">
		<p>320</p>
		<p>-12</p>
		<p>10500+$__grank*200</p>
<!--		<p>16000</p> -->
		<p>0</p>
		<p>90000+$__grank*2000</p>
		<p>$__middle_boss_prate</p>
	</createRef>
	<wait>1</wait>

	<!-- *** ボスのライフ表示オブジェクト作成 *** -->
	<createRef label="boss_life_create"></createRef>

	<!-- *** ボス戦が終わるまで待機                  *** -->	
	<!-- *** 最終形態が終わると Lock 10 が開放される *** -->
	<setLock><num>10</num></setLock>
	<waitLock><num>10</num></waitLock>

</action>

<!-- ********************************************************************* -->
<!-- *** 中ボスオブジェクト作成                                        *** -->
<!-- ***                                                               *** -->
<create label="enemy_create_middle_boss">
	<speed>0</speed><dir>0</dir>
	<cx>$1</cx><cy>$2</cy>
	<vital>$3</vital>
	<inv>$4</inv>
	<score>$5</score>
	<prate>$6</prate>
	<enemyRef label="enemy_middle_boss"></enemyRef>
</create>

<!-- ********************************************************************* -->
<!-- *** 中ボスオブジェクト                                            *** -->
<enemy label="enemy_middle_boss">

	<collision type="circle"><cx>-1</cx><cy>-1</cy><radius>0</radius></collision>
	<presentRef label="stage_middle_boss_present_01"></presentRef>

	<!-- *** VITAL ゲージはボスの子オブジェクトなのでここで作成 *** -->
	<createRef label="boss_vital_create"></createRef>

	<!-- *** 画面下のボス表示を作成 *** -->
	<createRef label="boss_underbar_create"></createRef>

	<!-- タイマー差分初期化 -->
	<global name="end_offset">0</global>
	<global name="end_flag">0</global>
<!--
	<debugstr><string>ecrystal2</string></debugstr>
	<debugval><num>$_ecrystal2</num></debugval>
-->
	<!-- *** 第 N 形態ごとのアクション *** -->
	<repeat><times>$__boss_state-eq1</times>
		<eval name="cross_over">90</eval>
		<revengeRef label="stage_middle_boss_01_revenge"><p>$cross_over</p></revengeRef>

		<global name="timer">12</global>
		<global name="timerwait">240</global>
		<global name="end_offset">0</global>
		<actionRef  label="create_timer0"></actionRef>
		<actionRef  label="stage_middle_boss_01_action"><p>$cross_over</p></actionRef> 
	</repeat>

	<repeat><times>$__boss_state-eq2*(1-$__boss_secret)</times>
		<eval name="cross_over">100</eval>
		<aRef l="p_avrage_add"/>
		<revengeRef label="stage_middle_boss_02_revenge"><p>$cross_over</p></revengeRef>

		<global name="timer">12</global>
		<global name="timerwait">220</global>
		<actionRef  label="create_timer"></actionRef>
		<actionRef  label="stage_middle_boss_02_action"><p>$cross_over</p></actionRef> 
	</repeat>

	<repeat><times>$__boss_state-eq2*$__boss_secret</times>
		<eval name="cross_over">90</eval>
		<aRef l="p_avrage_add"/>
		<revengeRef label="stage_middle_boss_03_revenge"><p>$cross_over</p></revengeRef>

		<global name="timer">12</global>
		<global name="timerwait">233</global>
		<actionRef  label="create_timer"></actionRef>
		<actionRef  label="stage_middle_boss_03_action"><p>$cross_over</p></actionRef> 
	</repeat>


</enemy>


<!-- ********************************************************************* -->
<!-- *** 中ボスのアクション　第１形態　                                *** -->
<!-- ***                                                               *** -->

<action  label="stage_middle_boss_01_action">
	<changeSpeed>
		<speed>4</speed><tm>0</tm>
	</changeSpeed>
	<changeDirection>
		<dir type="abs">180</dir><tm>0</tm>
	</changeDirection>
	<wait>15</wait>


	<changeSpeed>
		<speed>0</speed><tm>40</tm>
	</changeSpeed>
	<wait>45</wait>
	<collision type="circle"><cx>-1</cx><cy>-1</cy><radius>20</radius></collision>
	<createRef l="boss_ring"><p>$1</p></createRef>

	<!-- 弾幕開始 -->
	<actionRef label="start_boss_bullet"/>

<repeat><times>4</times>
	<!-- タイマーチェック -->
	<eval name="time_check1">$_stageplayframe</eval>
	<!-- 難易度調整用 -->
	<global name="temp_grank">$__grank</global>


	<!-- 弾数（４の倍数) -->
	<eval name="b_num">4*(2+$__temp_grank)</eval>
	<eval name="sq">120</eval>
	<eval name="w_time">72</eval>
	<eval name="aim_dir">0</eval>
	<eval name="rank_jd">1-($__temp_grank-gt2)*2</eval>
	<eval name="wt_tm">12-($__temp_grank-gt3)*2+($__temp_grank-lt2)*2</eval>
	<eval name="rp_tm">5+($__temp_grank-gt3)-($__temp_grank-lt2)</eval>
	<w>1</w>


	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_mb_01"><p>$aim_dir</p><p>$w_time</p><p>4</p><p>$sq</p></fRef>
	<repeat><times>($b_num/4)-1</times>
		<fRef l="enemy_fire_mb_01s"><p>360/$b_num</p><p>$w_time</p><p>4</p><p>$sq</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>($b_num/4)</times>
		<fRef l="enemy_fire_mb_01s"><p>360/$b_num</p><p>$w_time</p><p>3</p><p>$sq</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>($b_num/4)</times>
		<fRef l="enemy_fire_mb_01s"><p>360/$b_num</p><p>$w_time</p><p>2</p><p>$sq</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>($b_num/4)</times>
		<fRef l="enemy_fire_mb_01s"><p>360/$b_num</p><p>$w_time</p><p>1</p><p>$sq</p></fRef>
	</repeat>
	<w>1</w>
	<evaladd name="w_time">-10</evaladd>
	<eval name="sq">($sq+8)*$rank_jd</eval>

	<w>$wt_tm</w>

	<repeat><times>$rp_tm</times>
		<aRef l="enemy_bullet_action8"><p>64</p></aRef>
		<fRef l="enemy_fire_mb_01s"><p>$aim_dir</p><p>$w_time</p><p>4</p><p>$sq</p></fRef>
		<repeat><times>($b_num/4)-1</times>
			<fRef l="enemy_fire_mb_01s"><p>360/$b_num</p><p>$w_time</p><p>4</p><p>$sq</p></fRef>
		</repeat>
		<w>1</w>
		<repeat><times>($b_num/4)</times>
			<fRef l="enemy_fire_mb_01s"><p>360/$b_num</p><p>$w_time</p><p>3</p><p>$sq</p></fRef>
		</repeat>
		<w>1</w>
		<repeat><times>($b_num/4)</times>
			<fRef l="enemy_fire_mb_01s"><p>360/$b_num</p><p>$w_time</p><p>2</p><p>$sq</p></fRef>
		</repeat>
		<w>1</w>
		<repeat><times>($b_num/4)</times>
			<fRef l="enemy_fire_mb_01s"><p>360/$b_num</p><p>$w_time</p><p>1</p><p>$sq</p></fRef>
		</repeat>
		<w>1</w>
		<evaladd name="w_time">-10</evaladd>
		<eval name="sq">($sq-8)*$rank_jd</eval>
		<w>$wt_tm</w>
	</repeat>

	<w>30-($__temp_grank-gt3)*2+($__temp_grank-lt2)*4</w>
	<eval name="mv_dir">($_player_cx+$_player_cy)%2</eval>
	<w>10</w>

	<chD><dir type="absolute">-80+160*$mv_dir</dir><tm>1</tm></chD>
	<chS><sp>3</sp><tm>20</tm></chS>
	<w>30</w>
	<chS><sp>0</sp><tm>10</tm></chS>
	<w>117</w>

	<!-- 難易度調整用 -->
	<global name="temp_grank">$__grank</global>
	<w>2</w>

	<!-- 狙い紫 -->
	<chD><dir type="absolute">-90+180*(1-$mv_dir)</dir><tm>1</tm></chD>
	<chS><sp>3</sp><tm>10</tm></chS>
	<eval name="b_dir">-150*(1-$mv_dir*2)</eval>
	<eval name="b_sp">3.2</eval>
	<eval name="wt_tm2">2*(6-$__temp_grank)</eval>
	<w>2</w>

	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_mb_02r"><p>$b_dir</p><p>$b_sp</p></fRef>
	<repeat><times>5-($__temp_grank-lt2)-($__temp_grank-lt1)</times>
		<evaladd name="b_sp">-0.4</evaladd>
		<fRef l="enemy_fire_mb_02s"><p>0</p><p>$b_sp</p></fRef>
	</repeat>
	<repeat><times>$__temp_grank-lt3</times>
		<w>8</w>
	</repeat>
	<repeat><times>1-($__temp_grank-lt3)</times>
		<eval name="b_sp">3.0</eval>
		<eval name="l_dir">20-($__temp_grank-gt3)*10</eval>
		<repeat><times>($__temp_grank-2)</times>
				<fRef l="enemy_fire_mb_02s_2"><p>-60</p><p>$b_sp</p><p>-1*$l_dir</p></fRef>
				<fRef l="enemy_fire_mb_02s_2"><p>120</p><p>$b_sp</p><p>$l_dir</p></fRef>
				<evaladd name="l_dir">10</evaladd>
			<w>2</w>
		</repeat>
		<w>$wt_tm2</w>
	</repeat>

	<repeat><times>4-($__temp_grank-lt2)</times>
		<eval name="b_sp">3.2</eval>
		<evaladd name="b_dir">10*(1-$mv_dir*2)</evaladd>
		<aRef l="enemy_bullet_action8"><p>64</p></aRef>
		<fRef l="enemy_fire_mb_02r"><p>$b_dir</p><p>$b_sp</p></fRef>
		<repeat><times>5-($__temp_grank-lt2)-($__temp_grank-lt1)</times>
			<evaladd name="b_sp">-0.4</evaladd>
			<fRef l="enemy_fire_mb_02s"><p>0</p><p>$b_sp</p></fRef>
		</repeat>
		<repeat><times>$__temp_grank-lt3</times>
			<w>8</w>
		</repeat>
		<repeat><times>1-($__temp_grank-lt3)</times>
			<eval name="b_sp">3.0</eval>
			<eval name="l_dir">20-($__temp_grank-gt3)*10</eval>
			<repeat><times>($__temp_grank-2)</times>
					<fRef l="enemy_fire_mb_02s_2"><p>-60</p><p>$b_sp</p><p>-1*$l_dir</p></fRef>
					<fRef l="enemy_fire_mb_02s_2"><p>120</p><p>$b_sp</p><p>$l_dir</p></fRef>
					<evaladd name="l_dir">10</evaladd>
				<w>2</w>
			</repeat>
			<w>$wt_tm2</w>
		</repeat>
	</repeat>

	<repeat><times>4-($__temp_grank-lt2)</times>
		<eval name="b_sp">3.2</eval>
		<evaladd name="b_dir">10*(1-$mv_dir*2)</evaladd>
		<fRef l="enemy_fire_mb_02r"><p>$b_dir</p><p>$b_sp</p></fRef>
		<repeat><times>5-($__temp_grank-lt2)-($__temp_grank-lt1)</times>
			<evaladd name="b_sp">-0.4</evaladd>
			<fRef l="enemy_fire_mb_02s"><p>0</p><p>$b_sp</p></fRef>
		</repeat>
		<repeat><times>$__temp_grank-lt3</times>
			<aRef l="enemy_bullet_action4"><p>64</p></aRef>
			<w>8</w>
		</repeat>
		<repeat><times>1-($__temp_grank-lt3)</times>
			<aRef l="enemy_bullet_action8"><p>64</p></aRef>
			<eval name="b_sp">3.0</eval>
			<eval name="l_dir">20-($__temp_grank-gt3)*10</eval>
			<repeat><times>($__temp_grank-2)</times>
					<fRef l="enemy_fire_mb_02s_2"><p>-60</p><p>$b_sp</p><p>-1*$l_dir</p></fRef>
					<fRef l="enemy_fire_mb_02s_2"><p>120</p><p>$b_sp</p><p>$l_dir</p></fRef>
					<evaladd name="l_dir">10</evaladd>
				<w>2</w>
			</repeat>
			<w>$wt_tm2</w>
		</repeat>
	</repeat>
	<w>16*($__temp_grank-lt2)</w>
	<chS><sp>0</sp><tm>10</tm></chS>
	<w>117</w>

	<!-- 難易度調整用 -->
	<global name="temp_grank">$__grank</global>
	<w>3</w>

	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_mb_03"><p>0</p><p>1</p><p>0</p></fRef>

	<chD><dir type="absolute">95-190*(1-$mv_dir)</dir><tm>1</tm></chD>
	<chS><sp>2.44</sp><tm>10</tm></chS>
	<repeat><times>6-($__temp_grank-lt2)</times>
		<repeat><times>1-($__temp_grank-gt3)</times>
			<w>10</w>
		</repeat>
		<repeat><times>$__temp_grank-gt3</times>
			<w>5</w>
			<aRef l="enemy_bullet_action8"><p>64</p></aRef>
			<fRef l="enemy_fire_mb_03s"><p>30.5+5*($mv_dir)</p><p>1</p><p>($_self_cx+$_player_cx)%37</p></fRef>
			<w>5</w>
		</repeat>
		<aRef l="enemy_bullet_action8"><p>64</p></aRef>
		<fRef l="enemy_fire_mb_03s"><p>50+10*($mv_dir)</p><p>1</p><p>($_self_cx+$_player_cx)%37</p></fRef>

	</repeat>
	<w>10*($__temp_grank-lt2)</w>
	<chS><sp>0</sp><tm>10</tm></chS>
	<w>150</w>


	<!-- タイマーチェック -->
<!--
	<eval name="time_check2">$_stageplayframe-$time_check1</eval>
	<debugstr><string>midbossB</string></debugstr>
	<debugval><num>$time_check2</num></debugval>
-->
</repeat>
<global name="end_flag">1</global>

</action>

<!-- ********************************************************************* -->
<!-- *** 中ボスのアクション　第２形態　                                *** -->
<!-- ***                                                               *** -->

<action  label="stage_middle_boss_02_action">

<!-- センターポイントへ移動 -->
	<changeSpeed>
		<speed type="absolute">2</speed><term>25</term>
	</changeSpeed>

	<changePosition type="center">
		<x>320</x><y>160</y>
	</changePosition>
	<changeSpeed>
		<speed type="absolute">0</speed><term>2</term>
	</changeSpeed>

	<wait>2</wait>

	<collision type="circle"><cx>-1</cx><cy>-1</cy><radius>20</radius></collision>
	<createRef l="boss_ring"><p>$1</p></createRef>

	<!-- 弾幕開始 -->
	<actionRef label="start_boss_bullet"/>

	<!-- 難易度調整用 -->
	<global name="temp_grank">$__grank</global>

	<wait>1</wait>

<repeat><times>5</times>

<!-- 難易度調整用 -->
<global name="temp_grank">$__grank</global>

<!-- 一度止まって溜まるばら撒き -->
<eval name="line_num">3+($__temp_grank-gt0)+($__temp_grank-gt1)+($__temp_grank-gt2)</eval>
<eval name="line_rad">360/$line_num</eval>
<eval name="base_sp">0.8+($__temp_grank)*0.1+($__temp_grank-gt2)*0.3+($__temp_grank-gt3)*0.4</eval>
<eval name="last_sp">$base_sp+($_player_cy%7)/10</eval>
<eval name="rad_offset1">9.3-($__temp_grank)*0.8</eval>
<eval name="rad_offset2">11.6-($__temp_grank)*0.7</eval>
<w>1</w>
<repeat><times>4</times>
	<!-- 難易度調整用 -->
	<global name="temp_grank">$__grank</global>

	<!-- タイマーチェック -->
	<eval name="time_check1">$_stageplayframe</eval>

	<eval name="rp_tm">9+($__temp_grank-gt2)*5+($__temp_grank-gt3)*6+($__temp_grank-gt4)*6</eval>
	<eval name="wt_tm">20-(($__temp_grank-gt2)*5+($__temp_grank-gt3)*6+($__temp_grank-gt4)*6)</eval>

	<w>2</w>

	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_mb_2_01"><p>27+($_player_cx%13)</p><p>4</p><p>$last_sp</p></fRef>
	<repeat><times>($line_num-1)</times>
		<fRef l="enemy_fire_mb_2_01s"><p>$line_rad</p><p>4</p><p>$last_sp</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>$rp_tm</times>
		<eval name="last_sp">$base_sp+(($_stageplayeframe+$_player_cx)%7)/10</eval>
		<fRef l="enemy_fire_mb_2_01s"><p>($line_rad)+$rad_offset1</p><p>4</p><p>$last_sp</p></fRef>
		<repeat><times>($line_num-1)</times>
			<fRef l="enemy_fire_mb_2_01s"><p>$line_rad</p><p>4</p><p>$last_sp</p></fRef>
		</repeat>
		<w>1</w>
	</repeat>
	<w>$wt_tm</w>
	<eval name="last_sp">$base_sp+($_player_cx%7)/10</eval>
	<w>15</w>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_mb_2_02"><p>22+($_player_cy%19)</p><p>4</p><p>$last_sp</p></fRef>
	<repeat><times>($line_num-1)</times>
		<fRef l="enemy_fire_mb_2_02s"><p>-1*$line_rad</p><p>4</p><p>$last_sp</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>$rp_tm</times>
		<eval name="last_sp">$base_sp+(($_stageplayeframe+$_player_cx)%7)/10</eval>
		<fRef l="enemy_fire_mb_2_02s"><p>-1*($line_rad)-$rad_offset2</p><p>4</p><p>$last_sp</p></fRef>
		<repeat><times>($line_num-1)</times>
			<fRef l="enemy_fire_mb_2_02s"><p>-1*$line_rad</p><p>4</p><p>$last_sp</p></fRef>
		</repeat>
		<w>1</w>
	</repeat>
	<w>$wt_tm</w>
	<eval name="last_sp">$base_sp+($_player_cy%7)/10</eval>
	<w>15</w>


	<!-- タイマーチェック -->
<!--
	<eval name="time_check2">$_stageplayframe-$time_check1</eval>
	<debugstr><string>midboss2</string></debugstr>
	<debugval><num>$time_check2</num></debugval>
-->
</repeat>
<w>120</w>
</repeat>
<global name="end_flag">1</global>
<wait>120</wait>
</action>

<!-- ********************************************************************* -->
<!-- *** 中ボスのアクション　第３形態　                                *** -->
<!-- ***                                                               *** -->

<action  label="stage_middle_boss_03_action">
<!-- SECRET MAGIC 演出 0:mid enemy magic  1:mid secret magic 2:boss enemy magic 3:boss secret magic-->
<actionRef label="enemy_magic_action"><p>1</p><param>50</param><param>120</param><param>35</param><param>125</param></actionRef>

<!-- センターポイントへ移動 -->
	<changeSpeed>
		<speed type="absolute">2</speed><term>25</term>
	</changeSpeed>

	<changePosition type="center">
		<x>320</x><y>140</y>
	</changePosition>
	<changeSpeed>
		<speed type="absolute">0</speed><term>2</term>
	</changeSpeed>

	<wait>2</wait>
	<wait>55</wait>

	<collision type="circle"><cx>-1</cx><cy>-1</cy><radius>20</radius></collision>
	<createRef l="boss_ring"><p>$1</p></createRef>

<!-- 弾幕開始 -->
	<actionRef label="start_boss_bullet"/>

	

<repeat><times>3</times>
	<!-- 難易度調整用 -->
	<global name="temp_grank">$__grank</global>
	<!-- タイマーチェック -->
	<eval name="time_check1">$_stageplayframe</eval>
	<eval name="mv_dir">80*(1-2*(($_player_cx+$_player_cy)%2))</eval>

	<aRef l="enemy_bullet_action2"><p>64</p></aRef>
	<fRef l="enemy_fire_mb_3_01"><p>30</p><p>1</p></fRef>
	<fRef l="enemy_fire_mb_3_01"><p>30</p><p>-1</p></fRef>
	<w>2</w>
	<fRef l="enemy_fire_mb_3_01s"><p>180</p><p>-1</p></fRef>
	<fRef l="enemy_fire_mb_3_01s"><p>60</p><p>1</p></fRef>
	<w>78</w>

	<aRef l="enemy_bullet_action2"><p>64</p></aRef>
	<fRef l="enemy_fire_mb_3_01"><p>0</p><p>1</p></fRef>
	<fRef l="enemy_fire_mb_3_01"><p>60</p><p>-1</p></fRef>
	<w>2</w>
	<fRef l="enemy_fire_mb_3_01s"><p>180</p><p>-1</p></fRef>
	<fRef l="enemy_fire_mb_3_01s"><p>60</p><p>1</p></fRef>
	<w>78</w>
	<aRef l="enemy_bullet_action2"><p>64</p></aRef>
	<fRef l="enemy_fire_mb_3_01"><p>2</p><p>1</p></fRef>
	<fRef l="enemy_fire_mb_3_01"><p>62</p><p>-1</p></fRef>
	<w>2</w>
	<fRef l="enemy_fire_mb_3_01s"><p>180</p><p>-1</p></fRef>
	<fRef l="enemy_fire_mb_3_01s"><p>60</p><p>1</p></fRef>

	<repeat><times>($__temp_grank-gt3)</times>
	<w>78</w>
	<aRef l="enemy_bullet_action2"><p>64</p></aRef>
	<fRef l="enemy_fire_mb_3_01"><p>22</p><p>1</p></fRef>
	<fRef l="enemy_fire_mb_3_01"><p>22</p><p>-1</p></fRef>
	<w>2</w>
	<fRef l="enemy_fire_mb_3_01s"><p>180</p><p>-1</p></fRef>
	<fRef l="enemy_fire_mb_3_01s"><p>60</p><p>1</p></fRef>
	<w>40</w>
	</repeat>

	<repeat><times>1-($__temp_grank-gt3)</times>
		<w>120</w>
	</repeat>

	<chS><sp>0.3</sp><tm>5</tm></chS>
	<chD><direction type="absolute">$mv_dir</direction><tm>1</tm></chD>
	<w>20</w>
	<chS><sp>0</sp><tm>5</tm></chS>
	<w>118</w>

	<!-- 難易度調整用 -->
	<global name="temp_grank">$__grank</global>

	<aRef l="enemy_bullet_action2"><p>64</p></aRef>
	<fRef l="enemy_fire_mb_3_01"><p>30</p><p>1</p></fRef>
	<fRef l="enemy_fire_mb_3_01"><p>30</p><p>-1</p></fRef>
	<w>2</w>
	<fRef l="enemy_fire_mb_3_01s"><p>180</p><p>-1</p></fRef>
	<fRef l="enemy_fire_mb_3_01s"><p>60</p><p>1</p></fRef>
	<w>78</w>

	<aRef l="enemy_bullet_action2"><p>64</p></aRef>
	<fRef l="enemy_fire_mb_3_01"><p>0</p><p>1</p></fRef>
	<fRef l="enemy_fire_mb_3_01"><p>60</p><p>-1</p></fRef>
	<w>2</w>
	<fRef l="enemy_fire_mb_3_01s"><p>180</p><p>-1</p></fRef>
	<fRef l="enemy_fire_mb_3_01s"><p>60</p><p>1</p></fRef>
	<w>78</w>

	<aRef l="enemy_bullet_action2"><p>64</p></aRef>
	<fRef l="enemy_fire_mb_3_01"><p>2</p><p>1</p></fRef>
	<fRef l="enemy_fire_mb_3_01"><p>62</p><p>-1</p></fRef>
	<w>2</w>
	<fRef l="enemy_fire_mb_3_01s"><p>180</p><p>-1</p></fRef>
	<fRef l="enemy_fire_mb_3_01s"><p>60</p><p>1</p></fRef>

	<repeat><times>($__temp_grank-gt3)</times>
	<w>78</w>
	<aRef l="enemy_bullet_action2"><p>64</p></aRef>
	<fRef l="enemy_fire_mb_3_01"><p>20</p><p>1</p></fRef>
	<fRef l="enemy_fire_mb_3_01"><p>20</p><p>-1</p></fRef>
	<w>2</w>
	<fRef l="enemy_fire_mb_3_01s"><p>180</p><p>-1</p></fRef>
	<fRef l="enemy_fire_mb_3_01s"><p>60</p><p>1</p></fRef>
	<w>40</w>
	</repeat>

	<repeat><times>1-($__temp_grank-gt3)</times>
		<w>120</w>
	</repeat>

	<chS><sp>0.3</sp><tm>5</tm></chS>
	<chD><direction type="relative">180</direction><tm>1</tm></chD>
	<w>20</w>
	<chS><sp>0</sp><tm>5</tm></chS>
	<w>118</w>

	<!-- タイマーチェック -->
<!--
	<eval name="time_check2">$_stageplayframe-$time_check1</eval>
	<debugstr><string>midboss3</string></debugstr>
	<debugval><num>$time_check2</num></debugval>
-->
</repeat>
<global name="end_flag">1</global>



</action>

<!-- ********************************************************************* -->
<!-- *** 中ボスのリベンジ　第１形態                                    *** -->
<!-- ***                                                               *** -->

<revenge label="stage_middle_boss_01_revenge">
	<eval name="localcounter">$_counter</eval>
	<eval name="ttc_end">$_ttc_frame</eval>

	<!-- ランク変動値、ボーナススピリット、スピリット桁数、クリスタル基本値、赤クリスタル基本値、４倍タイマー -->
	<eval name="rank_inc">900*($_difficulty+1)</eval>
	<eval name="crystal">(12+$_difficulty*2)</eval>
	<eval name="red_crystal">40</eval>
	<eval name="multi4">800+($__grank-gt2)*120</eval>
	<eval name="distance">$1</eval>

	<changeSpeed>
		<speed>0</speed><tm>1</tm>
	</changeSpeed>

	<!-- 爆発アクション -->
	<actionRef label="boss_revenge_present_1"></actionRef>
	<presentRef label="stage_middle_boss_revnege_present_01"></presentRef>

	<!-- *** 形態変数の増加 *** -->
	<global name="boss_state">$__boss_state+1</global>

	<!-- *** 表示ライフ減少 *** -->
	<global name="boss_life">$__boss_life-1</global>

	<!-- *** 弾幕のアイテム化 *** -->
	<repeat><times>$_revenge_state-eq1</times>
		<wait>1</wait>
		<changeBulletToItem/>
	</repeat>

	<wait>1</wait>

	<repeat><times>$_revenge_state-eq1</times>

		<eval name="counter_e">$__counter_tmp</eval>
		<actionRef label="item_counter_01_boss">
		<param>$crystal</param><param>$counter_e</param><param>$multi4</param><param>24</param><param>$localcounter</param><param>$rank_inc</param><param>$distance</param>
		</actionRef>
	</repeat>
	<repeat><times>$_revenge_state-eq3</times>
		<addRank><num>-2*$rank_inc</num></addRank>
		<actionRef label="item_counter_01_red"><param>$red_crystal</param></actionRef>
	</repeat>

	<wait>60</wait>

	<!-- *** 次の形態のボスの作成 *** -->
	<createRef label="enemy_create_middle_boss">
		<p>$_self_cx</p><p>$_self_cy</p><p>13000+$__temp_grank*200</p><p>0</p><p>100000+2000*$__grank</p><p>$__middle_boss_prate2</p>
	</createRef>

	<!-- *** 最後に自殺 *** -->
	<vanish></vanish>	
</revenge>

<!-- ********************************************************************* -->
<!-- *** 中ボスのリベンジ　第２形態                                    *** -->
<!-- ***                                                               *** -->

<revenge label="stage_middle_boss_02_revenge">
	<eval name="localcounter">$_counter</eval>
	<eval name="ttc_end">$_ttc_frame</eval>

	<!-- ランク変動値、ボーナススピリット、スピリット桁数、クリスタル基本値、赤クリスタル基本値、４倍タイマー -->
	<eval name="rank_inc">900*($_difficulty+1)</eval>
	<eval name="crystal">(14+$_difficulty*2)</eval>
	<eval name="red_crystal">40</eval>
	<eval name="multi4">720</eval>
	<eval name="distance">$1</eval>

	<changeSpeed>
		<speed>0</speed><tm>1</tm>
	</changeSpeed>

	<!-- 爆発アクション -->
	<actionRef label="boss_revenge_present_2"></actionRef>
	<presentRef label="stage_middle_boss_revnege_present_01"></presentRef>

	<!-- *** 弾幕のアイテム化 *** -->
	<!-- *** 自爆の場合は、弾けし *** -->
	<repeat><times>$_revenge_state-eq1</times>
		<wait>1</wait>
		<changeBulletToItem/>
	</repeat>
	<repeat><times>$_revenge_state-eq3</times>
		<wait>1</wait>
		<create>
			<speed>0</speed><direction>0</direction>
			<cx>320</cx><cy>240</cy><vital>0</vital>
			<bombRef label="bomb_clearbomb"></bombRef>
		</create>
	</repeat>

	<wait>1</wait>

	<repeat><times>$_revenge_state-eq1</times>
		
		<eval name="counter_e">$__counter_tmp</eval>
		<actionRef label="item_counter_01_boss">
		<param>$crystal</param><param>$counter_e</param><param>$multi4</param><param>24</param><param>$localcounter</param><param>$rank_inc</param><param>$distance</param>
		</actionRef>
	</repeat>
	<repeat><times>$_revenge_state-eq3</times>
		<addRank><num>-2*$rank_inc</num></addRank>
		<actionRef label="item_counter_01_red"><param>$red_crystal</param></actionRef>
	</repeat>

	<wait>60</wait>

	<!-- *** 侵食率低減 4.5% 以上 または侵食率10%以下 で第３形態へ *** -->
<!--
	<debugstr><string>Mboss-Secret Judge</string></debugstr>
	<debugval><num>$__start_prate</num></debugval>
-->

	<eval name="base">45000</eval>
	<eval name="judge">(((($__start_prate-$_prate)-gt$base)+($_prate-lt100000))-gt0)*($_stagemisscount-eq0)</eval>

	<repeat><times>$judge</times>
		<aRef l="secret_hint"><p>$base</p><p>($_prate-lt100000)</p></aRef>
		<global name="boss_secret">1</global>
		<sysvar name="secret">$_secret+1</sysvar>
		<actionRef label="boss_revenge_present_3"/>
		<createRef label="enemy_create_middle_boss">
			<p>$_self_cx</p><p>$_self_cy</p><p>14000+300*$__grank</p><p>0</p><p>120000+2000*$__grank</p><p>$__middle_boss_prate3</p>
		</createRef>
		<vanish/>
	</repeat>

	<repeat><times>1-$judge</times>
		<actionRef label="stage_middle_boss_final_revenge_action"></actionRef>
	</repeat>
</revenge>

<!-- ********************************************************************* -->
<!-- *** 中ボスのリベンジ　第３形態                                    *** -->
<!-- ***                                                               *** -->

<revenge label="stage_middle_boss_03_revenge">
	<eval name="localcounter">$_counter</eval>
	<eval name="ttc_end">$_ttc_frame</eval>

	<!-- ランク変動値、ボーナススピリット、スピリット桁数、クリスタル基本値、赤クリスタル基本値、４倍タイマー -->
	<eval name="rank_inc">1200*($_difficulty+1)</eval>
	<eval name="crystal">(16+$_difficulty*2)</eval>
	<eval name="red_crystal">40</eval>
	<eval name="multi4">1000</eval>
	<eval name="distance">$1</eval>

	<!-- Enemy Magic Break -->
	<eval name="emb_prate">-9000-($__grank-gt3)*2000-($__grank-gt4)*2000</eval>
	<eval name="emb_prate_tmp1">((-1*$emb_prate)/10000)%10</eval>
	<eval name="emb_prate_tmp2">((-1*$emb_prate)/1000)%10</eval>
	<eval name="emb_score">90000+($__grank-gt3)*20000+($__grank-gt4)*20000</eval>

	<changeSpeed>
		<speed>0</speed><tm>1</tm>
	</changeSpeed>

	<!-- 爆発アクション -->
	<actionRef label="boss_revenge_present_4"></actionRef>
	<actionRef label="bg_bossend_action"></actionRef>
	<presentRef label="stage_middle_boss_revnege_present_01"></presentRef>


	<!-- *** 弾幕のアイテム化 *** -->
	<!-- *** 自爆の場合は、弾けし *** -->
	<repeat><times>$_revenge_state-eq1</times>
		<wait>1</wait>
		<changeBulletToItem/>
	</repeat>
	<repeat><times>$_revenge_state-eq3</times>
		<wait>1</wait>
		<create>
			<speed>0</speed><direction>0</direction>
			<cx>320</cx><cy>240</cy><vital>0</vital>
			<bombRef label="bomb_clearbomb"></bombRef>
		</create>
	</repeat>

	<wait>1</wait>

	<repeat><times>$_revenge_state-eq1</times>
		<!-- *** ノーミスノーボムチェック *** -->
		<eval name="etb_j">(($ttc_end-$__ttc_start)-eq($localcounter-$__counter_tmp))*($__ttc_start-gt((300*$_magic_rate/100)-60))</eval>
		<repeat><times>$etb_j</times>
			<actionRef label="emb_letter"><p>$emb_prate_tmp1</p><p>$emb_prate_tmp2</p></actionRef>
			<addPRate><num>$emb_prate</num></addPRate>
			<addScore><score>$emb_score</score></addScore>
			<sysvar name="tbchain">$_tbchain+1</sysvar>
			<addRank><num>$rank_inc</num></addRank>
		</repeat>

		<eval name="counter_e">$__counter_tmp</eval>
		<actionRef label="item_counter_01_boss">
		<param>$crystal</param><param>$counter_e</param><param>$multi4</param><param>24</param><param>$localcounter</param><param>$rank_inc</param><param>$distance</param>
		</actionRef>
	</repeat>
	<repeat><times>$_revenge_state-eq3</times>
		<addRank><num>-3*$rank_inc</num></addRank>
		<actionRef label="item_counter_01_red"><param>$red_crystal</param></actionRef>
	</repeat>
	<wait>60</wait>

	<actionRef label="stage_middle_boss_final_revenge_action"></actionRef>
</revenge>


<!-- ********************************************************************* -->
<!-- *** 中ボスのリベンジ・サブアクション　最終形態                    *** -->
<!-- ***                                                               *** -->
<action label="stage_middle_boss_final_revenge_action">
	<!-- 画像の後始末 -->
	<targetRevenge label="stage_boss_timer_fig"></targetRevenge>
	<targetRevenge label="namebox"></targetRevenge>

	<targetRevenge label="boss_life"></targetRevenge>
	<actionRef l="bg_midbossend_action"></actionRef>

	<!-- *** ボス戦ロックを解除 *** -->
	<releaseLock><num>10</num></releaseLock>

	<!-- *** 終了 *** -->
	<vanish></vanish>	
</action>
	
</exbulletml>
