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

<!-- ********************************************************************* -->
<!-- *** 中ボス戦１回目                                                *** -->
<!-- ***                                                               *** -->

<action label="stage_middle_boss_action">

	<!-- *** 第 N 形態 *** -->
	<global name="boss_state">1</global>
	
	<!-- *** ボスの初期ライフ *** -->
	<global name="boss_life">1</global>

	<!-- *** 最初のボスオブジェクト作成 *** -->
	<!-- ｘ座標、y座標、体力、inv、スコア、侵食率 -->
	<createRef label="enemy_create_middle_boss">
		<p>320</p>
		<p>-12</p>
		<p>15000+$__temp_grank*200</p>
<!--		<p>16000</p> -->
		<p>0</p>
		<p>110000+$__temp_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_create2"></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">100</eval>
		<revengeRef label="stage_middle_boss_01_revenge"><p>$cross_over</p></revengeRef>

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

	<repeat><times>$__boss_state-eq2</times>
		<eval name="cross_over">110</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">200</global>
<!--		<actionRef  label="create_timer"></actionRef> -->
		<actionRef  label="stage_middle_boss_02_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>3</times>
	<!-- タイマーチェック -->
	<eval name="time_check1">$_stageplayframe</eval>
	<!-- 難易度調整用 -->
	<global name="temp_grank">$__grank</global>

	<!-- wait 28 -->
	<repeat><times>$__temp_grank-lt3</times>
		<aRef l="mb_01_action_1"><p>0</p></aRef>
	</repeat>
	<repeat><times>$__temp_grank-gt2</times>
		<aRef l="mb_01_action_2"><p>0</p></aRef>
	</repeat>
	<w>20</w>
	<chD><dir type="abs">-87+174*(($_player_cx+$_player_cy)%2)</dir><tm>1</tm></chD>
	<chS><sp type="abs">2</sp><tm>15</tm></chS>
	<w>15</w>
	<chS><sp type="abs">0</sp><tm>15</tm></chS>
	<w>15</w>
	<!-- wait 28 -->
	<repeat><times>$__temp_grank-lt3</times>
		<aRef l="mb_01_action_1"><p>8</p></aRef>
	</repeat>
	<repeat><times>$__temp_grank-gt2</times>
		<aRef l="mb_01_action_2"><p>8</p></aRef>
	</repeat>

	<w>15</w>
	<repeat><times>$__temp_grank-gt3</times>
		<aRef l="mb_01_action_2"><p>-12</p></aRef>
	</repeat>
	<w>90+(($__temp_grank-gt2)*28)</w>
	<eval name="dir1">1-2*($_self_cx-gt320)</eval>

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

	<aRef l="enemy_bullet_action"><p>64</p></aRef>
	<fRef l="enemy_fire_mb_02ab"><p>130*$dir1</p><p>32</p><p>$dir1</p></fRef>
	<w>25</w>
	<repeat><times>$__temp_grank-gt0</times>
		<aRef l="enemy_bullet_action"><p>64</p></aRef>
		<fRef l="enemy_fire_mb_02ab"><p>90*$dir1</p><p>22</p><p>$dir1</p></fRef>
	</repeat>
	<w>25</w>
	<repeat><times>$__temp_grank-gt2</times>
		<aRef l="enemy_bullet_action"><p>64</p></aRef>
		<fRef l="enemy_fire_mb_02ab"><p>50*$dir1</p><p>12</p><p>$dir1</p></fRef>
	</repeat>

	<chD><dir type="abs">90*$dir1</dir><tm>1</tm></chD>
	<chS><sp type="abs">2</sp><tm>15</tm></chS>
	<w>25</w>
	<chS><sp type="abs">0</sp><tm>15</tm></chS>
	<w>15</w>

	<eval name="dir1">1-2*($_self_cx-gt320)</eval>

	<aRef l="enemy_bullet_action"><p>64</p></aRef>
	<fRef l="enemy_fire_mb_02ab"><p>130*$dir1</p><p>34</p><p>$dir1</p></fRef>
	<w>25</w>
	<repeat><times>$__temp_grank-gt0</times>
		<aRef l="enemy_bullet_action"><p>64</p></aRef>
		<fRef l="enemy_fire_mb_02ab"><p>90*$dir1</p><p>23</p><p>$dir1</p></fRef>
	</repeat>
	<w>25</w>
	<repeat><times>$__temp_grank-gt2</times>
		<aRef l="enemy_bullet_action"><p>64</p></aRef>
		<fRef l="enemy_fire_mb_02ab"><p>50*$dir1</p><p>12</p><p>$dir1</p></fRef>
	</repeat>

	<chD><dir type="abs">91*$dir1</dir><tm>1</tm></chD>
	<chS><sp type="abs">1.3</sp><tm>15</tm></chS>
	<w>15</w>
	<chS><sp type="abs">0</sp><tm>15</tm></chS>
	<w>65</w>
	
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>	
	<fRef l="enemy_fire_mb_05ab"><p>45</p></fRef>
	<fRef l="enemy_fire_mb_05s"><p>90</p></fRef>
	<fRef l="enemy_fire_mb_05s"><p>90</p></fRef>
	<fRef l="enemy_fire_mb_05s"><p>90</p></fRef>
	<repeat><times>9</times>
	<w>3</w>
	<fRef l="enemy_fire_mb_05s"><p>108-($__temp_grank*3)+($__temp_grank-gt3)*2+($__temp_grank-gt4)*2</p></fRef>
	<fRef l="enemy_fire_mb_05s"><p>90</p></fRef>
	<fRef l="enemy_fire_mb_05s"><p>90</p></fRef>
	<fRef l="enemy_fire_mb_05s"><p>90</p></fRef>
	</repeat>
	<w>3</w>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>	
	<fRef l="enemy_fire_mb_05ab"><p>108-($__temp_grank*3)+($__temp_grank-gt3)*2+($__temp_grank-gt4)*2</p></fRef>
	<fRef l="enemy_fire_mb_05s"><p>90</p></fRef>
	<fRef l="enemy_fire_mb_05s"><p>90</p></fRef>
	<fRef l="enemy_fire_mb_05s"><p>90</p></fRef>
	<repeat><times>9</times>
	<w>3</w>
	<fRef l="enemy_fire_mb_05s"><p>108-($__temp_grank*3)+($__temp_grank-gt3)*2+($__temp_grank-gt4)*2</p></fRef>
	<fRef l="enemy_fire_mb_05s"><p>90</p></fRef>
	<fRef l="enemy_fire_mb_05s"><p>90</p></fRef>
	<fRef l="enemy_fire_mb_05s"><p>90</p></fRef>
	</repeat>

	<repeat><times>$__temp_grank-gt3</times>
		<aRef l="enemy_bullet_action8"><p>64</p></aRef>	
		<repeat><times>10</times>
		<w>3</w>
		<fRef l="enemy_fire_mb_05s"><p>108-($__temp_grank*3)+($__temp_grank-gt3)*2+($__temp_grank-gt4)*2</p></fRef>
		<fRef l="enemy_fire_mb_05s"><p>90</p></fRef>
		<fRef l="enemy_fire_mb_05s"><p>90</p></fRef>
		<fRef l="enemy_fire_mb_05s"><p>90</p></fRef>
		</repeat>
	</repeat>

	<w>50-($__temp_grank-gt3)*30</w>
	<!-- 難易度調整用 -->
	<global name="temp_grank">$__grank</global>

	<eval name="offset">13-($__temp_grank-gt0)*2-($__temp_grank-gt1)*2-($__temp_grank-gt3)</eval>
	<eval name="sp1">0.6</eval>
	<w>5</w>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>	
	<fRef l="enemy_fire_mb_04"><p>-6*$offset</p><p>$sp1</p><p>5</p></fRef>
	<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>5</p></fRef>
	<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>5</p></fRef>
	<repeat><times>2</times>
		<fRef l="enemy_fire_mb_04s"><p>120+$offset</p><p>$sp1</p><p>5</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>5</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>5</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>3</times>
		<fRef l="enemy_fire_mb_04s"><p>120+$offset</p><p>$sp1</p><p>4</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>4</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>4</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>3</times>
		<fRef l="enemy_fire_mb_04s"><p>120+$offset</p><p>$sp1</p><p>3</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>3</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>3</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>3</times>
		<fRef l="enemy_fire_mb_04s"><p>120+$offset</p><p>$sp1</p><p>2</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>2</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>2</p></fRef>
	</repeat>
	<w>3</w>


	<repeat><times>7+($__temp_grank-gt3)</times>
	<add name="sp1">0.2</add>
	<fRef l="enemy_fire_mb_04s"><p>120-(11*$offset)-0.5-($__temp_grank-gt2)*0.2-($__temp_grank-gt3)*0.3-($__temp_grank-gt4)*0.3</p><p>$sp1</p><p>5</p></fRef>
	<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>5</p></fRef>
	<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>5</p></fRef>
	<repeat><times>2</times>
		<fRef l="enemy_fire_mb_04s"><p>120+$offset</p><p>$sp1</p><p>5</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>5</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>5</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>3</times>
		<fRef l="enemy_fire_mb_04s"><p>120+$offset</p><p>$sp1</p><p>4</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>4</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>4</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>3</times>
		<fRef l="enemy_fire_mb_04s"><p>120+$offset</p><p>$sp1</p><p>3</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>3</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>3</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>3</times>
		<fRef l="enemy_fire_mb_04s"><p>120+$offset</p><p>$sp1</p><p>2</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>2</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>2</p></fRef>
	</repeat>
	<w>3</w>
	</repeat>

	<w>60-(($__temp_grank-gt3)*6)</w>

	<eval name="sp1">0.5</eval>
	<w>5</w>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>	
	<fRef l="enemy_fire_mb_04s"><p>120+17</p><p>$sp1</p><p>5</p></fRef>
	<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>5</p></fRef>
	<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>5</p></fRef>
	<repeat><times>2</times>
		<fRef l="enemy_fire_mb_04s"><p>120-$offset</p><p>$sp1</p><p>5</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>5</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>5</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>3</times>
		<fRef l="enemy_fire_mb_04s"><p>120-$offset</p><p>$sp1</p><p>4</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>4</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>4</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>3</times>
		<fRef l="enemy_fire_mb_04s"><p>120-$offset</p><p>$sp1</p><p>3</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>3</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>3</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>3</times>
		<fRef l="enemy_fire_mb_04s"><p>120-$offset</p><p>$sp1</p><p>2</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>2</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>2</p></fRef>
	</repeat>
	<w>3</w>


	<repeat><times>7+($__temp_grank-gt3)</times>
	<add name="sp1">0.2</add>
	<fRef l="enemy_fire_mb_04s"><p>120+(11*$offset)+0.5+($__temp_grank-gt2)*0.2+($__temp_grank-gt3)*0.3+($__temp_grank-gt4)*0.3</p><p>$sp1</p><p>5</p></fRef>
	<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>5</p></fRef>
	<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>5</p></fRef>
	<repeat><times>2</times>
		<fRef l="enemy_fire_mb_04s"><p>120-$offset</p><p>$sp1</p><p>5</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>5</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>5</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>3</times>
		<fRef l="enemy_fire_mb_04s"><p>120-$offset</p><p>$sp1</p><p>4</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>4</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>4</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>3</times>
		<fRef l="enemy_fire_mb_04s"><p>120-$offset</p><p>$sp1</p><p>3</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>3</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>3</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>3</times>
		<fRef l="enemy_fire_mb_04s"><p>120-$offset</p><p>$sp1</p><p>2</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>2</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>120</p><p>$sp1</p><p>2</p></fRef>
	</repeat>
	<w>3</w>
	</repeat>

	<w>100-(($__temp_grank-gt3)*6)</w>

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

</action>

<a l="mb_01_action_1">
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_mb_01d"><p>0+$1</p><p>1.6</p></fRef>
	<w>1</w>
	<fRef l="enemy_fire_mb_01ds"><p>120</p><p>1.6</p></fRef>
	<w>1</w>
	<fRef l="enemy_fire_mb_01ds"><p>120</p><p>1.6</p></fRef>
	<w>5</w>
	<fRef l="enemy_fire_mb_01ds"><p>120+60</p><p>1.6</p></fRef>
	<w>1</w>
	<fRef l="enemy_fire_mb_01ds"><p>120</p><p>1.6</p></fRef>
	<w>1</w>
	<fRef l="enemy_fire_mb_01ds"><p>120</p><p>1.6</p></fRef>
	<w>5</w>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_mb_01ds"><p>120+30</p><p>1.6</p></fRef>
	<w>1</w>
	<fRef l="enemy_fire_mb_01ds"><p>120</p><p>1.6</p></fRef>
	<w>1</w>
	<fRef l="enemy_fire_mb_01ds"><p>120</p><p>1.6</p></fRef>
	<w>5</w>
	<fRef l="enemy_fire_mb_01ds"><p>120+60</p><p>1.6</p></fRef>
	<w>1</w>
	<fRef l="enemy_fire_mb_01ds"><p>120</p><p>1.6</p></fRef>
	<w>1</w>
	<fRef l="enemy_fire_mb_01ds"><p>120</p><p>1.6</p></fRef>
	<w>5</w>
</a>

<a l="mb_01_action_2">
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_mb_01d"><p>0+$1</p><p>1.7</p></fRef>
	<w>1</w>
	<fRef l="enemy_fire_mb_01ds"><p>90</p><p>1.7</p></fRef>
	<w>1</w>
	<fRef l="enemy_fire_mb_01ds"><p>90</p><p>1.7</p></fRef>
	<w>1</w>
	<fRef l="enemy_fire_mb_01ds"><p>90</p><p>1.7</p></fRef>
	<w>4</w>
	<fRef l="enemy_fire_mb_01ds"><p>90+45</p><p>1.7</p></fRef>
	<w>1</w>
	<fRef l="enemy_fire_mb_01ds"><p>90</p><p>1.7</p></fRef>
	<w>1</w>
	<fRef l="enemy_fire_mb_01ds"><p>90</p><p>1.7</p></fRef>
	<w>1</w>
	<fRef l="enemy_fire_mb_01ds"><p>90</p><p>1.7</p></fRef>
	<w>4</w>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_mb_01ds"><p>90+22.5</p><p>1.7</p></fRef>
	<w>1</w>
	<fRef l="enemy_fire_mb_01ds"><p>90</p><p>1.7</p></fRef>
	<w>1</w>
	<fRef l="enemy_fire_mb_01ds"><p>90</p><p>1.7</p></fRef>
	<w>1</w>
	<fRef l="enemy_fire_mb_01ds"><p>90</p><p>1.7</p></fRef>
	<w>4</w>
	<fRef l="enemy_fire_mb_01ds"><p>90+45</p><p>1.7</p></fRef>
	<w>1</w>
	<fRef l="enemy_fire_mb_01ds"><p>90</p><p>1.7</p></fRef>
	<w>1</w>
	<fRef l="enemy_fire_mb_01ds"><p>90</p><p>1.7</p></fRef>
	<w>1</w>
	<fRef l="enemy_fire_mb_01ds"><p>90</p><p>1.7</p></fRef>
	<w>4</w>
</a>



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

<action  label="stage_middle_boss_02_action">

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

	<changePosition type="center">
		<x>320</x><y>170</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>

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

	<cRef l="enemy_create_mb_01d"><p>1</p></cRef>
	<w>18</w>
	<repeat><times>$__temp_grank-gt1</times>
		<cRef l="enemy_create_mb_02d"><p>2.4</p></cRef>
	</repeat>
	<w>18</w>
	<cRef l="enemy_create_mb_01d"><p>3.6</p></cRef>
	<w>18</w>
	<repeat><times>$__temp_grank-gt3</times>
		<cRef l="enemy_create_mb_03d"><p>-4</p></cRef>
	</repeat>

	<repeat><times>20</times>
		<w>120</w>
		<!-- 難易度調整用 -->
		<global name="temp_grank">$__grank</global>
		<repeat><times>$__temp_grank-lt2</times>
			<targetRevenge label="enemy_mb_02d"></targetRevenge>
			<targetRevenge label="enemy_mb_03d"></targetRevenge>
			<targetRevenge label="enemy_mb_04d"></targetRevenge>
		</repeat>
		<repeat><times>$__temp_grank-lt3</times>
			<targetRevenge label="enemy_mb_03d"></targetRevenge>
			<targetRevenge label="enemy_mb_04d"></targetRevenge>
		</repeat>
		<repeat><times>$__temp_grank-lt4</times>
			<targetRevenge label="enemy_mb_04d"></targetRevenge>
		</repeat>
	</repeat>

	<!-- タイマーチェック -->
<!--	<eval name="time_check2">$_stageplayframe-$time_check1</eval>
	<debugstr><string>midboss1</string></debugstr>
	<debugval><num>$time_check2</num></debugval>
-->
</action>


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

<revenge label="stage_middle_boss_01_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">1100</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>14200+200*$__grank</p><p>0</p><p>125000+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">1200*($_difficulty+1)</eval>
	<eval name="crystal">(18+$_difficulty*2)</eval>
	<eval name="red_crystal">60</eval>
	<eval name="multi4">1000</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>
	<actionRef label="stage_middle_boss_final_revenge_action1"></actionRef>
</revenge>


<!-- ********************************************************************* -->
<!-- *** 中ボスのリベンジ・サブアクション　最終形態                    *** -->
<!-- ***                                                               *** -->
<action label="stage_middle_boss_final_revenge_action1">
	<createRef label="item_create_05"><param>0</param><param>-64</param></createRef>

	<targetRevenge label="boss_life"></targetRevenge>

	<!-- 画像の後始末 -->
	<targetRevenge label="stage_boss_timer_fig"></targetRevenge>
	<targetRevenge label="namebox"></targetRevenge>

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

	<!-- *** 逃走 *** -->
	<changeColor>
		<alpha>255</alpha><red>255</red><green>255</green><blue>255</blue><term>1</term>
	</changeColor>

	<chS><sp type="abs">4.2</sp><tm>60</tm></chS>
	<chD><dir type="abs">-50+100*($_self_cx-gt320)</dir><tm>1</tm></chD>

</action>



<!-- ********************************************************************* -->
<!-- *** 中ボス戦２回目                                                *** -->
<!-- ***                                                               *** -->

<action label="stage_middle_boss_action2">

	<!-- *** 第 N 形態 *** -->
	<global name="boss_state">1</global>
	
	<!-- *** ボスの初期ライフ *** -->
	<global name="boss_life">1</global>

	<!-- *** 最初のボスオブジェクト作成 *** -->
	<!-- ｘ座標、y座標、体力、inv、スコア、侵食率 -->
	<createRef label="enemy_create_middle_boss2">
		<p>320</p>
		<p>-12</p>
		<p>6100+$__temp_grank*50</p>
<!--		<p>16000</p> -->
		<p>0</p>
		<p>125000+$__temp_grank*2000</p>
		<p>$__middle_boss_prate3</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_boss2">
	<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_boss2"></enemyRef>
</create>

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

	<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_create2"></createRef>

	<!-- タイマー差分初期化 -->
	<global name="end_offset">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_03_revenge"><p>$cross_over</p></revengeRef>

		<global name="timer">4</global>
		<global name="timerwait">150</global>
		<actionRef  label="create_timer0"></actionRef>
		<actionRef  label="stage_middle_boss_03_action"><p>$cross_over</p></actionRef> 
	</repeat>

	<repeat><times>$__boss_state-eq2</times>
		<eval name="cross_over">100</eval>
		<aRef l="p_avrage_add"/>
		<revengeRef label="stage_middle_boss_04_revenge"><p>$cross_over</p></revengeRef>

		<global name="timer">12</global>
		<global name="timerwait">249</global>
<!--		<actionRef  label="create_timer"></actionRef> -->
		<actionRef  label="stage_middle_boss_04_action"><p>$cross_over</p></actionRef> 
	</repeat>

	<repeat><times>$__boss_state-eq3</times>
		<eval name="cross_over">110</eval>
		<aRef l="p_avrage_add"/>
		<revengeRef label="stage_middle_boss_05_revenge"><p>$cross_over</p></revengeRef>

		<global name="timer">12</global>
		<global name="timerwait">226</global>
<!--		<actionRef  label="create_timer"></actionRef> -->
		<actionRef  label="stage_middle_boss_05_action"><p>$cross_over</p></actionRef> 
	</repeat>

</enemy>


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

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


	<changeSpeed>
		<speed>0</speed><tm>30</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"/>

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

<repeat><times>2</times>
	<!-- 難易度調整用 -->
	<global name="temp_grank">$__grank</global>
	
	<eval name="player_pos1">$_player_cx</eval>

	<cRef l="enemy_create_mb3_01"><p>90</p><p>24</p><p>1</p></cRef>
	<w>15</w>
	<cRef l="enemy_create_mb3_01"><p>-90</p><p>24</p><p>0</p></cRef>
	<w>15</w>
	<cRef l="enemy_create_mb3_01"><p>105</p><p>18</p><p>0</p></cRef>
	<w>15</w>
	<cRef l="enemy_create_mb3_01"><p>-105</p><p>18</p><p>0</p></cRef>
	<w>15</w>
	<cRef l="enemy_create_mb3_01"><p>120</p><p>12</p><p>0</p></cRef>
	<w>15</w>
	<cRef l="enemy_create_mb3_01"><p>-120</p><p>12</p><p>1</p></cRef>
	<w>15</w>
	<cRef l="enemy_create_mb3_01"><p>135</p><p>12</p><p>0</p></cRef>
	<w>15</w>
	<cRef l="enemy_create_mb3_01"><p>-135</p><p>12</p><p>0</p></cRef>
	<w>15</w>

	<chD><dir type="abs">95-190*($player_pos1-gt$_player_cx)</dir><tm>1</tm></chD>
	<chS><sp type="abs">2.2</sp><tm>20</tm></chS>
	<w>15</w>
	<fRef l="enemy_fire_mb3_01d"><p>0</p></fRef>
	<w>15</w>
	<chS><sp type="abs">0</sp><tm>20</tm></chS>
	<w>15</w>
	<fRef l="enemy_fire_mb3_01d"><p>12</p></fRef>
	<w>15</w>
	<fRef l="enemy_fire_mb3_01d"><p>-12</p></fRef>
	<w>15</w>
	<fRef l="enemy_fire_mb3_01d"><p>0</p></fRef>
	<w>15</w>
	<fRef l="enemy_fire_mb3_01d"><p>30</p></fRef>
	<w>15</w>
	<fRef l="enemy_fire_mb3_01d"><p>-30</p></fRef>
	<w>15</w>
	<repeat><times>$__temp_grank-gt4</times>
		<fRef l="enemy_fire_mb3_01d"><p>0</p></fRef>
	</repeat>
	<w>50</w>
</repeat>

	<!-- タイマーチェック -->
<!--	<eval name="time_check2">$_stageplayframe-$time_check1</eval>
	<debugstr><string>midboss1</string></debugstr>
	<debugval><num>$time_check2</num></debugval>
-->
</action>

<!-- ********************************************************************* -->
<!-- *** 中ボスのアクション　２回目EM　                                *** -->
<!-- ***                                                               *** -->

<action  label="stage_middle_boss_04_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>0</p><param>50</param><param>64</param><param>64</param><param>64</param></actionRef>

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

	<changePosition type="center">
		<x>320</x><y>142</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>5</times>

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

	<eval name="w_time">25</eval>
	<eval name="bul_num">4+($__temp_grank)-($__temp_grank-gt4)</eval>

	<!-- 狙い -->

	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_mb4_01"><p>0</p><p>$w_time</p></fRef>
	<w>6</w>
	<repeat><times>$bul_num-1</times>
		<add name="w_time">2</add>
		<fRef l="enemy_fire_mb4_01s"><p>360/$bul_num</p><p>$w_time</p></fRef>
		<w>6</w>
	</repeat>

	<w>80-($bul_num*6)</w>
	<eval name="w_time">25</eval>

	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_mb4_01"><p>0</p><p>$w_time</p></fRef>
	<w>6</w>
	<repeat><times>$bul_num-1</times>
		<add name="w_time">2</add>
		<fRef l="enemy_fire_mb4_01s"><p>360/$bul_num</p><p>$w_time</p></fRef>
		<w>6</w>
	</repeat>

	<w>80-($bul_num*6)</w>

	<eval name="bul_rad">22.5-($__temp_grank-gt0)*2.5-($__temp_grank-gt1)*5-($__temp_grank-gt2)*3-($__temp_grank-gt3)*2</eval>
	<eval name="rad_t">180/$bul_rad</eval>
	<eval name="rad_w">4+($__temp_grank-lt2)</eval>
	<w>7</w>

	<!-- ばらまき -->
	<eval name="w_time">20</eval>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_mb4_01_2"><p>-90</p><p>$w_time</p></fRef>
	<w>$rad_w</w>
	<repeat><times>$rad_t-1</times>
		<fRef l="enemy_fire_mb4_01_2s"><p>$bul_rad</p><p>$w_time</p></fRef>
		<w>$rad_w</w>
	</repeat>

	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<repeat><times>$rad_t</times>
		<fRef l="enemy_fire_mb4_01_2s"><p>$bul_rad</p><p>$w_time</p></fRef>
		<w>$rad_w</w>
	</repeat>

	<w>12</w>

	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_mb4_01_2s"><p>$bul_rad+($_player_cx%13)</p><p>$w_time</p></fRef>
	<w>$rad_w</w>
	<repeat><times>$rad_t-1</times>
		<fRef l="enemy_fire_mb4_01_2s"><p>$bul_rad*2</p><p>$w_time</p></fRef>
		<w>$rad_w</w>
	</repeat>

	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_mb4_01_2s"><p>$bul_rad+($_player_cy%13)</p><p>$w_time</p></fRef>
	<w>$rad_w</w>
	<repeat><times>$rad_t-1</times>
		<fRef l="enemy_fire_mb4_01_2s"><p>$bul_rad*2</p><p>$w_time</p></fRef>
		<w>$rad_w</w>
	</repeat>


	<repeat><times>$__temp_grank-gt3</times>
		<aRef l="enemy_bullet_action8"><p>64</p></aRef>
		<fRef l="enemy_fire_mb4_01"><p>0</p><p>$w_time</p></fRef>
		<w>6</w>
		<fRef l="enemy_fire_mb4_01s"><p>72</p><p>$w_time</p></fRef>
		<w>6</w>
		<fRef l="enemy_fire_mb4_01s"><p>72</p><p>$w_time</p></fRef>
		<w>6</w>
		<fRef l="enemy_fire_mb4_01s"><p>72</p><p>$w_time</p></fRef>
		<w>6</w>
		<fRef l="enemy_fire_mb4_01s"><p>72</p><p>$w_time</p></fRef>
	</repeat>

	<w>60-($__temp_grank-gt3)*24</w>

	<eval name="dir_x">6-($__temp_grank-gt4)</eval>

	<repeat><times>$__temp_grank-gt0</times>
		<aRef l="enemy_bullet_action8"><p>64</p></aRef>
		<fRef l="enemy_fire_mb4_01_2"><p>0</p><p>$w_time</p></fRef>
	</repeat>
	<w>4</w>
	<repeat><times>$__temp_grank-gt1</times>
		<fRef l="enemy_fire_mb4_01_2s"><p>$dir_x</p><p>$w_time</p></fRef>
		<fRef l="enemy_fire_mb4_01_2s"><p>-2*$dir_x</p><p>$w_time</p></fRef>
	</repeat>
	<w>4</w>
	<repeat><times>$__temp_grank-gt2</times>
		<fRef l="enemy_fire_mb4_01_2s"><p>3*$dir_x</p><p>$w_time</p></fRef>
		<fRef l="enemy_fire_mb4_01_2s"><p>-4*$dir_x</p><p>$w_time</p></fRef>
	</repeat>
	<w>4</w>
	<repeat><times>$__temp_grank-gt3</times>
		<fRef l="enemy_fire_mb4_01_2s"><p>5*$dir_x</p><p>$w_time</p></fRef>
		<fRef l="enemy_fire_mb4_01_2s"><p>-6*$dir_x</p><p>$w_time</p></fRef>
	</repeat>
	<w>4</w>
	<repeat><times>$__temp_grank-gt4</times>
		<fRef l="enemy_fire_mb4_01_2s"><p>7*$dir_x</p><p>$w_time</p></fRef>
		<fRef l="enemy_fire_mb4_01_2s"><p>-8*$dir_x</p><p>$w_time</p></fRef>
	</repeat>
	<w>318-($rad_t*4*$rad_w)</w>


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

</action>

<!-- ********************************************************************* -->
<!-- *** 中ボスのアクション　２回目SM　                                *** -->
<!-- ***                                                               *** -->

<action  label="stage_middle_boss_05_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>64</param><param>64</param><param>64</param></actionRef>

<!-- センターポイントへ移動 -->
	<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>
	<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>9</times>	
	<!-- 難易度調整用 -->
	<global name="temp_grank">$__grank</global>

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

	<!-- ばらまき -->
	<eval name="bul_rad">18-($__temp_grank-gt0)*3-($__temp_grank-gt1)*3-($__temp_grank-gt2)*2</eval>
	<eval name="rad_t">180/$bul_rad</eval>
	<eval name="rad_w">2+($__temp_grank-lt2)</eval>
	<eval name="w_time">18</eval>
	<eval name="offset">0.1+0.1*($__temp_grank+1-(($__temp_grank-eq5)*0.5))</eval>
	<w>5</w>

	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_mb5_01_2"><p>-90</p><p>$w_time</p><p>$offset</p></fRef>
	<w>$rad_w</w>
	<repeat><times>$rad_t-1</times>
		<fRef l="enemy_fire_mb5_01_2s"><p>$bul_rad</p><p>$w_time</p><p>$offset</p></fRef>
		<w>$rad_w</w>
	</repeat>

	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<repeat><times>$rad_t</times>
		<fRef l="enemy_fire_mb5_01_2s"><p>$bul_rad</p><p>$w_time</p><p>$offset</p></fRef>
		<w>$rad_w</w>
	</repeat>

	<w>90-($rad_t*$rad_w*2)</w>

	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_mb5_01_2"><p>90</p><p>$w_time</p><p>-1*$offset</p></fRef>
	<fRef l="enemy_fire_mb5_01_2s"><p>180</p><p>$w_time</p><p>$offset</p></fRef>
	<w>$rad_w</w>
	<repeat><times>$rad_t-1</times>
		<fRef l="enemy_fire_mb5_01_2s"><p>180-1*$bul_rad</p><p>$w_time</p><p>-1*$offset</p></fRef>
		<fRef l="enemy_fire_mb5_01_2s"><p>180</p><p>$w_time</p><p>$offset</p></fRef>
		<w>$rad_w</w>
	</repeat>

	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_mb5_01_2s"><p>180-0.5*$bul_rad</p><p>$w_time</p><p>-1*$offset</p></fRef>
	<fRef l="enemy_fire_mb5_01_2s"><p>180</p><p>$w_time</p><p>$offset</p></fRef>
	<w>$rad_w</w>
	<repeat><times>$rad_t-1</times>
		<fRef l="enemy_fire_mb5_01_2s"><p>180-1*$bul_rad</p><p>$w_time</p><p>-1*$offset</p></fRef>
		<fRef l="enemy_fire_mb5_01_2s"><p>180</p><p>$w_time</p><p>$offset</p></fRef>
		<w>$rad_w</w>
	</repeat>

	<w>90-($rad_t*$rad_w*2)</w>

	<eval name="w_time">15</eval>

	<aRef l="enemy_bullet_action4"><p>64</p></aRef>
	<fRef l="enemy_fire_mb5_01"><p>90</p><p>$w_time</p></fRef>
	<add name="w_time">3</add>
	<fRef l="enemy_fire_mb5_01"><p>-90</p><p>$w_time</p></fRef>
	<w>6</w>
	<repeat><times>$__temp_grank-gt2</times>
		<add name="w_time">3</add>
		<fRef l="enemy_fire_mb5_01s"><p>90</p><p>$w_time</p></fRef>
		<add name="w_time">3</add>
		<fRef l="enemy_fire_mb5_01s"><p>180</p><p>$w_time</p></fRef>
	</repeat>
	<w>6</w>
	<repeat><times>$__temp_grank-gt3</times>
		<add name="w_time">3</add>
		<fRef l="enemy_fire_mb5_01s"><p>45</p><p>$w_time</p></fRef>
		<add name="w_time">3</add>
		<fRef l="enemy_fire_mb5_01s"><p>180</p><p>$w_time</p></fRef>
	</repeat>
	<w>6</w>
	<repeat><times>$__temp_grank-gt4</times>
		<add name="w_time">3</add>
		<fRef l="enemy_fire_mb5_01s"><p>45</p><p>$w_time</p></fRef>
		<add name="w_time">3</add>
		<fRef l="enemy_fire_mb5_01s"><p>180</p><p>$w_time</p></fRef>
	</repeat>

	<w>85</w>

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

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

<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">420</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>
	<actionRef label="boss_revenge_present_3"/>

	<!-- *** BUZZ 181以上でsecretへ *** -->
<!--	<debugstr><string>mboss-Secret Judge</string></debugstr>
	<debugval><num>$_buzz</num></debugval>
-->
	<eval name="base">180</eval>

	<!-- *** 次の形態のボスの作成 EM *** -->
	<repeat><times>($_buzz-gt$base)*($_stagemisscount-eq0)</times>
		<!-- *** 形態数3 secret *** -->
		<sysvar name="secret">$_secret+1</sysvar>
		<aRef l="secret_hint"><p>$base</p></aRef>
		<global name="boss_state">$__boss_state+1</global>
		<createRef label="enemy_create_middle_boss2">
			<p>$_self_cx</p><p>$_self_cy</p><p>14800+300*$__grank</p><p>0</p><p>200000+2000*$__grank</p><p>$__middle_boss_prate4</p>
		</createRef>
	</repeat>
	<repeat><times>1-(($_buzz-gt$base)*($_stagemisscount-eq0))</times>
		<!-- *** 形態数2 *** -->
		<createRef label="enemy_create_middle_boss2">
			<p>$_self_cx</p><p>$_self_cy</p><p>13500+300*$__grank</p><p>0</p><p>170000+2000*$__grank</p><p>$__middle_boss_prate4</p>
		</createRef>
	</repeat>

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

<!-- ********************************************************************* -->
<!-- *** 中ボスのリベンジ　２回目EM                                    *** -->
<!-- ***                                                               *** -->

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

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

	<!-- Enemy Magic Break -->
	<eval name="emb_prate">-12000-($__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">140000+($__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_action2"></actionRef>
</revenge>

<!-- ********************************************************************* -->
<!-- *** 中ボスのリベンジ　２回目SM                                    *** -->
<!-- ***                                                               *** -->

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

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

	<!-- Enemy Magic Break -->
	<eval name="emb_prate">-12000-($__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">160000+($__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_action2"></actionRef>
</revenge>


<!-- ********************************************************************* -->
<!-- *** 中ボスのリベンジ・サブアクション　最終形態                    *** -->
<!-- ***                                                               *** -->

<action label="stage_middle_boss_final_revenge_action2">

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

	<!-- 画像の後始末 -->
	<targetRevenge label="stage_boss_timer_fig"></targetRevenge>
	<targetRevenge label="namebox"></targetRevenge>

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

	<!-- *** 自爆 *** -->
	<vanish/>

</action>

	
</exbulletml>
