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

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

<!-- 暫定 -->
<!-- ボススコア、タイマー -->
<!-- ボスの周りのリング -->
<!-- start boss bullet -->

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

	<!-- *** 最初のボスオブジェクト作成 *** -->
	<!-- ｘ座標、y座標、体力、スコア、タイムボーナス、abs -->
	<createRef label="enemy_create_middle_boss">
		<p>380</p>
		<p>-12</p>
		<p>12000</p>
<!--		<p>16000</p> -->
		<p>800</p>
		<p>2400+200*$_difficulty</p>
		<p>500000</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>0</inv>
	<score>0</score>
	<prate>$6</prate>
	<flag>128</flag>
	<enemyRef label="enemy_middle_boss"><p>$5</p><p>$4</p></enemyRef>  <!-- score渡す -->
</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>

	<!-- *** ダミーボス作成（第１形態以外） *** -->
	<createRef label="enemy_create_boss_dummy"></createRef>

	<!-- タイマー差分初期化 -->
	<global name="end_flag">0</global>
	<!-- *** タイマー開始 *** -->
	<global name="boss_timer_start">0</global>
	<!-- *** ダミータイマー *** -->
	<cRef label="stage_boss_timer_create0"/>

	<!-- *** 第 N 形態ごとのアクション *** -->
	<repeat><times>$__boss_state-eq1</times>
		<eval name="boss_time">2700</eval>
		<revengeRef label="stage_middle_boss_01_revenge"><p>$boss_time</p><p>$1</p><p>$2</p></revengeRef> <!-- $1はスコア -->
		<actionRef  label="stage_middle_boss_01_action"><p>$boss_time</p></actionRef> 
	</repeat>

	<repeat><times>$__boss_state-eq2</times>
		<!-- ランク計算 -->
		<aRef label="calc_rank_action_stage2"/>

		<eval name="boss_time">2600</eval>
		<revengeRef label="stage_middle_boss_02_revenge"><p>$boss_time</p><p>$1</p><p>$2</p></revengeRef> <!-- $1はスコア -->
		<actionRef  label="stage_middle_boss_02_action"><p>$boss_time</p></actionRef> 
	</repeat>


</enemy>


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

<action  label="stage_middle_boss_01_action">
	<changeSpeed>
		<speed>5</speed><tm>0</tm>
	</changeSpeed>
	<changeDirection>
		<dir type="abs">220</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>25</radius></collision>

	<!-- 弾幕開始 -->
	<aRef label="start_boss_bullet"><p>$1</p></aRef>

	<eval name="save_cx">$_self_cx</eval>
	<eval name="save_cy">$_self_cy</eval>
	<eval name="t_count">1</eval>

	<debugval><num>$_self_cx</num></debugval>
	<debugval><num>$_self_cy</num></debugval>
	<debugval><num>$_counter</num></debugval>


<repeat><times>3</times>

	<repeat><times>$_difficulty-eq0</times>
		<aRef l="middle_boss_01_1_act00"></aRef>
	</repeat>
	<repeat><times>($_difficulty-eq1)+($_difficulty-eq2)</times>
		<aRef l="middle_boss_01_1_act01"></aRef>
	</repeat>
	<repeat><times>$_difficulty-eq3</times>
		<aRef l="middle_boss_01_1_act02"></aRef>
	</repeat>

	<chS><sp>4</sp><tm>10</tm></chS>
	<chD><dir type="abs">100</dir><tm>1</tm></chD>
	<w>60</w>
	<chS><sp>0</sp><tm>10</tm></chS>
	<w>50</w>

	<repeat><times>$_difficulty-eq0</times>
		<aRef l="middle_boss_01_1_act00"></aRef>
	</repeat>
	<repeat><times>($_difficulty-eq1)+($_difficulty-eq2)</times>
		<aRef l="middle_boss_01_1_act01"></aRef>
	</repeat>
	<repeat><times>$_difficulty-eq3</times>
		<aRef l="middle_boss_01_1_act02"></aRef>
	</repeat>

	<chS><sp>3</sp><tm>10</tm></chS>
	<chD><dir type="abs">-82</dir><tm>1</tm></chD>
	<w>40</w>
	<chS><sp>0</sp><tm>10</tm></chS>
	<w>10</w>

	<global name="temp_grank">$__grank</global>

	<repeat><times>$_difficulty-eq0</times>
		<aRef l="middle_boss_01_2_act00"></aRef>
	</repeat>
	<repeat><times>($_difficulty-eq1)+($_difficulty-eq2)</times>
		<aRef l="middle_boss_01_2_act01"></aRef>
	</repeat>
	<repeat><times>$_difficulty-eq3</times>
		<aRef l="middle_boss_01_2_act02"></aRef>
	</repeat>

	<w>30</w>
	<chS><sp>2</sp><tm>10</tm></chS>
	<chD><dir type="abs">180</dir><tm>1</tm></chD>
	<w>22</w>
	<chS><sp>0</sp><tm>10</tm></chS>
	<w>30</w>

	<global name="temp_grank">$__grank</global>

	<repeat><times>$_difficulty-eq0</times>
		<aRef l="middle_boss_01_3_act00"></aRef>
	</repeat>
	<repeat><times>($_difficulty-eq1)+($_difficulty-eq2)</times>
		<aRef l="middle_boss_01_3_act01"></aRef>
	</repeat>
	<repeat><times>$_difficulty-eq3</times>
		<aRef l="middle_boss_01_3_act02"></aRef>
	</repeat>

	<eval name="t_y">$_self_cy-$save_cy</eval>
	<eval name="t_x">$save_cx-$_self_cx</eval>
	<repeat><times>(($t_y-eq0)+($t_x-eq0))-eq0</times>
		<func name="t_mv" type="atan2"><p>$t_y</p><p>$t_x</p></func>
		<func name="t_dis0" type="cos"><p>$t_mv</p></func>
		<eval name="t_dis">$t_x/$t_dis0</eval>
		<func name="t_dis2" type="abs"><p>$t_dis</p></func>
	</repeat>
	<repeat><times>($t_x-eq0)</times>
		<eval name="t_mv">180*($_self_cy-lt200)</eval>
		<func name="t_dis2" type="abs"><p>$t_y</p></func>
	</repeat>
	<repeat><times>($t_y-eq0)</times>
		<eval name="t_mv">90-180*($_self_cx-gt400)</eval>		
		<func name="t_dis2" type="abs"><p>$t_x</p></func>
	</repeat>
	<w>5</w>

	<repeat><times>$t_count-lt3</times>
	<chD><dir type="abs">90-$t_mv</dir><tm>1</tm></chD>
	<chS><sp type="abs">$t_dis2/40</sp><tm>10</tm></chS>
	<w>40</w>
	<chS><sp type="abs">0</sp><tm>10</tm></chS>
	<w>45</w>
	</repeat>

	<debugval><num>$_self_cx</num></debugval>
	<debugval><num>$_self_cy</num></debugval>
	<debugval><num>$_counter</num></debugval>
	
	<global name="temp_grank">$__grank</global>
	<evaladd name="t_count">1</evaladd>
</repeat>

</action>

<a l="middle_boss_01_1_act00">

	<eval name="t_sp">4.2+$__temp_grank*0.1</eval>

	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_m01"><p>-40</p><p>$t_sp</p></fRef>
	<repeat><times>4</times>
		<fRef l="enemy_fire_m01s"><p>20</p><p>$t_sp</p></fRef>
	</repeat>
	<w>3</w>
	<evaladd name="t_sp">-0.1</evaladd>

	<repeat><times>8</times>
	<fRef l="enemy_fire_m01s"><p>-70</p><p>$t_sp</p></fRef>
	<repeat><times>3</times>
		<fRef l="enemy_fire_m01s"><p>20</p><p>$t_sp</p></fRef>
	</repeat>
	<w>3</w>
	<evaladd name="t_sp">-0.1</evaladd>

	<fRef l="enemy_fire_m01s"><p>-70</p><p>$t_sp</p></fRef>
	<repeat><times>4</times>
		<fRef l="enemy_fire_m01s"><p>20</p><p>$t_sp</p></fRef>
	</repeat>
	<w>3</w>
	<evaladd name="t_sp">-0.1</evaladd>
	</repeat>
	<w>12</w>

</a>

<a l="middle_boss_01_1_act01">

	<eval name="t_sp">4.7+$__temp_grank*0.1</eval>

	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_m01"><p>-32</p><p>$t_sp</p></fRef>
	<repeat><times>4</times>
		<fRef l="enemy_fire_m01s"><p>16</p><p>$t_sp</p></fRef>
	</repeat>
	<w>3</w>
	<evaladd name="t_sp">-0.1</evaladd>

	<repeat><times>10</times>
	<fRef l="enemy_fire_m01s"><p>-56</p><p>$t_sp</p></fRef>
	<repeat><times>3</times>
		<fRef l="enemy_fire_m01s"><p>16</p><p>$t_sp</p></fRef>
	</repeat>
	<w>3</w>
	<evaladd name="t_sp">-0.1</evaladd>

	<fRef l="enemy_fire_m01s"><p>-56</p><p>$t_sp</p></fRef>
	<repeat><times>4</times>
		<fRef l="enemy_fire_m01s"><p>16</p><p>$t_sp</p></fRef>
	</repeat>
	<w>3</w>
	<evaladd name="t_sp">-0.1</evaladd>
	</repeat>

</a>


<a l="middle_boss_01_1_act02">

	<eval name="t_sp">5.2+$__temp_grank*0.1</eval>

	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_m01"><p>-35</p><p>$t_sp</p></fRef>
	<repeat><times>7</times>
		<fRef l="enemy_fire_m01s"><p>10</p><p>$t_sp</p></fRef>
	</repeat>
	<w>3</w>
	<evaladd name="t_sp">-0.1</evaladd>

	<repeat><times>10</times>
	<fRef l="enemy_fire_m01s"><p>-65</p><p>$t_sp</p></fRef>
	<repeat><times>6</times>
		<fRef l="enemy_fire_m01s"><p>10</p><p>$t_sp</p></fRef>
	</repeat>
	<w>3</w>
	<evaladd name="t_sp">-0.1</evaladd>

	<fRef l="enemy_fire_m01s"><p>-65</p><p>$t_sp</p></fRef>
	<repeat><times>7</times>
		<fRef l="enemy_fire_m01s"><p>10</p><p>$t_sp</p></fRef>
	</repeat>
	<w>3</w>
	<evaladd name="t_sp">-0.1</evaladd>
	</repeat>

</a>

<a l="middle_boss_01_2_act00">

	<eval name="t_sp">5</eval>
	<eval name="t_sp2">3.0+$__temp_grank*0.05</eval>
	<eval name="t_dir">165</eval>
	<eval name="t_wait">10</eval>

	<repeat><times>8</times>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<repeat><times>3</times>
		<fRef l="enemy_fire_m01_2ab"><p>30</p><p>$t_sp</p><p>$t_wait</p><p>$t_dir</p><p>-1*$t_dir</p><p>$t_sp2</p></fRef>
		<fRef l="enemy_fire_m01_2s"><p>60</p><p>$t_sp</p><p>$t_wait</p><p>$t_dir</p><p>-1*$t_dir</p><p>$t_sp2</p></fRef>
		<fRef l="enemy_fire_m01_2s"><p>60</p><p>$t_sp</p><p>$t_wait</p><p>$t_dir</p><p>-1*$t_dir</p><p>$t_sp2</p></fRef>
		<fRef l="enemy_fire_m01_2s"><p>60</p><p>$t_sp</p><p>$t_wait</p><p>$t_dir</p><p>-1*$t_dir</p><p>$t_sp2</p></fRef>
		<fRef l="enemy_fire_m01_2s"><p>60</p><p>$t_sp</p><p>$t_wait</p><p>$t_dir</p><p>-1*$t_dir</p><p>$t_sp2</p></fRef>
		<fRef l="enemy_fire_m01_2s"><p>60</p><p>$t_sp</p><p>$t_wait</p><p>$t_dir</p><p>-1*$t_dir</p><p>$t_sp2</p></fRef>
		<w>6</w>
		<evaladd name="t_dir">-6</evaladd>
		<evaladd name="t_wait">1</evaladd>
		<w>6</w>
	</repeat>
	</repeat>

</a>

<a l="middle_boss_01_2_act01">

	<eval name="t_sp">5</eval>
	<eval name="t_sp2">3.2+$__temp_grank*0.05</eval>
	<eval name="t_dir">105</eval>
	<eval name="t_wait">10</eval>

	<repeat><times>5</times>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<repeat><times>3</times>
		<fRef l="enemy_fire_m01_2ab"><p>30</p><p>$t_sp</p><p>$t_wait</p><p>$t_dir</p><p>-1*$t_dir</p><p>$t_sp2</p></fRef>
		<fRef l="enemy_fire_m01_2s"><p>60</p><p>$t_sp</p><p>$t_wait</p><p>$t_dir</p><p>-1*$t_dir</p><p>$t_sp2</p></fRef>
		<fRef l="enemy_fire_m01_2s"><p>60</p><p>$t_sp</p><p>$t_wait</p><p>$t_dir</p><p>-1*$t_dir</p><p>$t_sp2</p></fRef>
		<fRef l="enemy_fire_m01_2s"><p>60</p><p>$t_sp</p><p>$t_wait</p><p>$t_dir</p><p>-1*$t_dir</p><p>$t_sp2</p></fRef>
		<fRef l="enemy_fire_m01_2s"><p>60</p><p>$t_sp</p><p>$t_wait</p><p>$t_dir</p><p>-1*$t_dir</p><p>$t_sp2</p></fRef>
		<fRef l="enemy_fire_m01_2s"><p>60</p><p>$t_sp</p><p>$t_wait</p><p>$t_dir</p><p>-1*$t_dir</p><p>$t_sp2</p></fRef>
		<w>5</w>
		<evaladd name="t_dir">-6</evaladd>
		<evaladd name="t_wait">1</evaladd>
		<w>5</w>
	</repeat>
		<fRef l="enemy_fire_m01_2X"><p>0</p><p>$t_sp2</p></fRef>
	</repeat>

	<eval name="t_dir">95</eval>
	<repeat><times>4</times>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<repeat><times>3</times>
		<fRef l="enemy_fire_m01_2ab"><p>30</p><p>$t_sp</p><p>$t_wait</p><p>$t_dir</p><p>-1*$t_dir</p><p>$t_sp2</p></fRef>
		<fRef l="enemy_fire_m01_2s"><p>60</p><p>$t_sp</p><p>$t_wait</p><p>$t_dir</p><p>-1*$t_dir</p><p>$t_sp2</p></fRef>
		<fRef l="enemy_fire_m01_2s"><p>60</p><p>$t_sp</p><p>$t_wait</p><p>$t_dir</p><p>-1*$t_dir</p><p>$t_sp2</p></fRef>
		<fRef l="enemy_fire_m01_2s"><p>60</p><p>$t_sp</p><p>$t_wait</p><p>$t_dir</p><p>-1*$t_dir</p><p>$t_sp2</p></fRef>
		<fRef l="enemy_fire_m01_2s"><p>60</p><p>$t_sp</p><p>$t_wait</p><p>$t_dir</p><p>-1*$t_dir</p><p>$t_sp2</p></fRef>
		<fRef l="enemy_fire_m01_2s"><p>60</p><p>$t_sp</p><p>$t_wait</p><p>$t_dir</p><p>-1*$t_dir</p><p>$t_sp2</p></fRef>
		<w>5</w>
		<evaladd name="t_dir">-6</evaladd>
		<evaladd name="t_wait">1</evaladd>
		<w>5</w>
	</repeat>
		<fRef l="enemy_fire_m01_2X"><p>0</p><p>$t_sp2</p></fRef>
	</repeat>
	<w>18</w>

</a>

<a l="middle_boss_01_2_act02">

	<eval name="t_sp">5</eval>
	<eval name="t_sp2">3.4+$__temp_grank*0.05</eval>
	<eval name="t_dir">165</eval>
	<eval name="t_wait">10</eval>

	<repeat><times>5</times>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<repeat><times>4</times>
		<fRef l="enemy_fire_m01_2ab"><p>30</p><p>$t_sp</p><p>$t_wait</p><p>$t_dir</p><p>-1*$t_dir</p><p>$t_sp2</p></fRef>
		<fRef l="enemy_fire_m01_2s"><p>60</p><p>$t_sp</p><p>$t_wait</p><p>$t_dir</p><p>-1*$t_dir</p><p>$t_sp2</p></fRef>
		<fRef l="enemy_fire_m01_2s"><p>60</p><p>$t_sp</p><p>$t_wait</p><p>$t_dir</p><p>-1*$t_dir</p><p>$t_sp2</p></fRef>
		<fRef l="enemy_fire_m01_2s"><p>60</p><p>$t_sp</p><p>$t_wait</p><p>$t_dir</p><p>-1*$t_dir</p><p>$t_sp2</p></fRef>
		<fRef l="enemy_fire_m01_2s"><p>60</p><p>$t_sp</p><p>$t_wait</p><p>$t_dir</p><p>-1*$t_dir</p><p>$t_sp2</p></fRef>
		<fRef l="enemy_fire_m01_2s"><p>60</p><p>$t_sp</p><p>$t_wait</p><p>$t_dir</p><p>-1*$t_dir</p><p>$t_sp2</p></fRef>
		<w>4</w>
		<evaladd name="t_dir">-7</evaladd>
		<evaladd name="t_wait">1</evaladd>
		<w>4</w>
	</repeat>
		<fRef l="enemy_fire_m01_2X"><p>-10</p><p>$t_sp2</p></fRef>
		<repeat><times>2</times>
			<fRef l="enemy_fire_m01_2Xs"><p>10</p><p>$t_sp2</p></fRef>
		</repeat>
	</repeat>

	<eval name="t_dir">105</eval>
	<repeat><times>4</times>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<repeat><times>4</times>
		<fRef l="enemy_fire_m01_2ab"><p>30</p><p>$t_sp</p><p>$t_wait</p><p>$t_dir</p><p>-1*$t_dir</p><p>$t_sp2</p></fRef>
		<fRef l="enemy_fire_m01_2s"><p>60</p><p>$t_sp</p><p>$t_wait</p><p>$t_dir</p><p>-1*$t_dir</p><p>$t_sp2</p></fRef>
		<fRef l="enemy_fire_m01_2s"><p>60</p><p>$t_sp</p><p>$t_wait</p><p>$t_dir</p><p>-1*$t_dir</p><p>$t_sp2</p></fRef>
		<fRef l="enemy_fire_m01_2s"><p>60</p><p>$t_sp</p><p>$t_wait</p><p>$t_dir</p><p>-1*$t_dir</p><p>$t_sp2</p></fRef>
		<fRef l="enemy_fire_m01_2s"><p>60</p><p>$t_sp</p><p>$t_wait</p><p>$t_dir</p><p>-1*$t_dir</p><p>$t_sp2</p></fRef>
		<fRef l="enemy_fire_m01_2s"><p>60</p><p>$t_sp</p><p>$t_wait</p><p>$t_dir</p><p>-1*$t_dir</p><p>$t_sp2</p></fRef>
		<w>4</w>
		<evaladd name="t_dir">-6</evaladd>
		<evaladd name="t_wait">1</evaladd>
		<w>4</w>
	</repeat>
		<fRef l="enemy_fire_m01_2X"><p>-10</p><p>$t_sp2</p></fRef>
		<repeat><times>2</times>
			<fRef l="enemy_fire_m01_2Xs"><p>10</p><p>$t_sp2</p></fRef>
		</repeat>
	</repeat>

</a>

<a l="middle_boss_01_3_act00">

	<eval name="t_sp">5</eval>
	<eval name="t_sp2">2.0+$__temp_grank*0.1</eval>

	<aRef l="enemy_bullet_action2"><p>64</p></aRef>
	<fRef l="enemy_fire_m01_4"><p>-60</p><p>$t_sp</p><p>1</p><p>$t_sp2</p></fRef>
	<fRef l="enemy_fire_m01_4"><p>60</p><p>$t_sp</p><p>-1</p><p>$t_sp2</p></fRef>
	<w>25</w>
	<aRef l="enemy_bullet_action2"><p>64</p></aRef>
	<fRef l="enemy_fire_m01_4"><p>-70</p><p>$t_sp</p><p>1</p><p>$t_sp2</p></fRef>
	<fRef l="enemy_fire_m01_4"><p>70</p><p>$t_sp</p><p>-1</p><p>$t_sp2</p></fRef>
	<w>25</w>
	<aRef l="enemy_bullet_action2"><p>64</p></aRef>
	<fRef l="enemy_fire_m01_4"><p>-80</p><p>$t_sp</p><p>1</p><p>$t_sp2</p></fRef>
	<fRef l="enemy_fire_m01_4"><p>80</p><p>$t_sp</p><p>-1</p><p>$t_sp2</p></fRef>
	<w>25</w>
	<aRef l="enemy_bullet_action2"><p>64</p></aRef>
	<fRef l="enemy_fire_m01_4"><p>-90</p><p>$t_sp</p><p>1</p><p>$t_sp2</p></fRef>
	<fRef l="enemy_fire_m01_4"><p>90</p><p>$t_sp</p><p>-1</p><p>$t_sp2</p></fRef>
	<w>60</w>

</a>

<a l="middle_boss_01_3_act01">

	<eval name="t_sp">5</eval>
	<eval name="t_sp2">2.4+$__temp_grank*0.1</eval>

	<aRef l="enemy_bullet_action2"><p>64</p></aRef>
	<fRef l="enemy_fire_m01_4_normal"><p>-60</p><p>$t_sp</p><p>1</p><p>$t_sp2</p></fRef>
	<fRef l="enemy_fire_m01_4_normal"><p>60</p><p>$t_sp</p><p>-1</p><p>$t_sp2</p></fRef>
	<w>25</w>
	<aRef l="enemy_bullet_action2"><p>64</p></aRef>
	<fRef l="enemy_fire_m01_4_normal"><p>-70</p><p>$t_sp</p><p>1</p><p>$t_sp2</p></fRef>
	<fRef l="enemy_fire_m01_4_normal"><p>70</p><p>$t_sp</p><p>-1</p><p>$t_sp2</p></fRef>
	<w>25</w>
	<aRef l="enemy_bullet_action2"><p>64</p></aRef>
	<fRef l="enemy_fire_m01_4_normal"><p>-80</p><p>$t_sp</p><p>1</p><p>$t_sp2</p></fRef>
	<fRef l="enemy_fire_m01_4_normal"><p>80</p><p>$t_sp</p><p>-1</p><p>$t_sp2</p></fRef>
	<w>25</w>
	<aRef l="enemy_bullet_action2"><p>64</p></aRef>
	<fRef l="enemy_fire_m01_4_normal"><p>-90</p><p>$t_sp</p><p>1</p><p>$t_sp2</p></fRef>
	<fRef l="enemy_fire_m01_4_normal"><p>90</p><p>$t_sp</p><p>-1</p><p>$t_sp2</p></fRef>
	<w>60</w>

</a>

<a l="middle_boss_01_3_act02">

	<eval name="t_sp">5</eval>
	<eval name="t_sp2">2.8+$__temp_grank*0.1</eval>

	<aRef l="enemy_bullet_action2"><p>64</p></aRef>
	<fRef l="enemy_fire_m01_4_hard"><p>-60</p><p>$t_sp</p><p>1</p><p>$t_sp2</p></fRef>
	<fRef l="enemy_fire_m01_4_hard"><p>60</p><p>$t_sp</p><p>-1</p><p>$t_sp2</p></fRef>
	<w>25</w>
	<aRef l="enemy_bullet_action2"><p>64</p></aRef>
	<fRef l="enemy_fire_m01_4_hard"><p>-70</p><p>$t_sp</p><p>1</p><p>$t_sp2</p></fRef>
	<fRef l="enemy_fire_m01_4_hard"><p>70</p><p>$t_sp</p><p>-1</p><p>$t_sp2</p></fRef>
	<w>25</w>
	<aRef l="enemy_bullet_action2"><p>64</p></aRef>
	<fRef l="enemy_fire_m01_4_hard"><p>-80</p><p>$t_sp</p><p>1</p><p>$t_sp2</p></fRef>
	<fRef l="enemy_fire_m01_4_hard"><p>80</p><p>$t_sp</p><p>-1</p><p>$t_sp2</p></fRef>
	<w>25</w>
	<aRef l="enemy_bullet_action2"><p>64</p></aRef>
	<fRef l="enemy_fire_m01_4_hard"><p>-90</p><p>$t_sp</p><p>1</p><p>$t_sp2</p></fRef>
	<fRef l="enemy_fire_m01_4_hard"><p>90</p><p>$t_sp</p><p>-1</p><p>$t_sp2</p></fRef>
	<w>45</w>
	<aRef l="enemy_bullet_action2"><p>64</p></aRef>
	<fRef l="enemy_fire_m01_4_hard"><p>-100</p><p>$t_sp</p><p>1</p><p>$t_sp2</p></fRef>
	<fRef l="enemy_fire_m01_4_hard"><p>100</p><p>$t_sp</p><p>-1</p><p>$t_sp2</p></fRef>
	<w>15</w>

</a>

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

<action  label="stage_middle_boss_02_action">

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

	<changePosition type="center">
		<x>400</x><y>200</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>25</radius></collision>

	<!-- 弾幕開始 -->
	<aRef label="start_boss_bullet"><p>$1</p></aRef>

	<w>1</w>
	

<repeat><times>4</times>
	<repeat><times>$_difficulty-eq0</times>
		<aRef l="middle_boss_02_1_act00"></aRef>
	</repeat>
	<repeat><times>($_difficulty-eq1)+($_difficulty-eq2)</times>
		<aRef l="middle_boss_02_1_act01"></aRef>
	</repeat>
	<repeat><times>$_difficulty-eq3</times>
		<aRef l="middle_boss_02_1_act02"></aRef>
	</repeat>


	<chS><sp>1</sp><tm>10</tm></chS>
	<chD><dir type="abs">-88+176*($_player_cx%2)</dir><tm>1</tm></chD>
	<w>30</w>
	<chS><sp>0</sp><tm>10</tm></chS>
	<w>60</w>

	<debugval><num>$_self_cx</num></debugval>
	<debugval><num>$_self_cy</num></debugval>
	<debugval><num>$_counter</num></debugval>


	<repeat><times>$_difficulty-eq0</times>
		<aRef l="middle_boss_02_1_act00"></aRef>
	</repeat>
	<repeat><times>($_difficulty-eq1)+($_difficulty-eq2)</times>
		<aRef l="middle_boss_02_1_act01"></aRef>
	</repeat>
	<repeat><times>$_difficulty-eq3</times>
		<aRef l="middle_boss_02_1_act02"></aRef>
	</repeat>


	<chS><sp>1</sp><tm>10</tm></chS>
	<chD><dir type="rel">180</dir><tm>1</tm></chD>
	<w>30</w>
	<chS><sp>0</sp><tm>10</tm></chS>
	<w>60</w>

	<debugval><num>$_self_cx</num></debugval>
	<debugval><num>$_self_cy</num></debugval>
	<debugval><num>$_counter</num></debugval>

</repeat>
	<repeat><times>$_difficulty-eq0</times>
		<aRef l="middle_boss_02_1_act00"></aRef>
	</repeat>
	<repeat><times>($_difficulty-eq1)+($_difficulty-eq2)</times>
		<aRef l="middle_boss_02_1_act01"></aRef>
	</repeat>
	<repeat><times>$_difficulty-eq3</times>
		<aRef l="middle_boss_02_1_act02"></aRef>
	</repeat>

</action>


<a l="middle_boss_02_1_act00">

	<eval name="SPEED">3.4+($__temp_grank*0.05)</eval>
	<eval name="t_bul">2</eval>
	<eval name="t_dir">1-2*($_player_cx-lt400)</eval>
	<eval name="OFFSETDIR">180</eval>
	<eval name="SUBWAIT">90</eval>
	<w>1</w>

	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fireRef label="enemy_fire_m02"><p>0</p><p>$SPEED</p><p>$t_dir</p><p>$OFFSETDIR</p><p>$SUBWAIT</p><p>$t_bul</p></fireRef>
	<fireRef label="enemy_fire_m02s"><p>90*$t_dir</p><p>0.8*$SPEED</p><p>-1*$t_dir</p><p>$OFFSETDIR</p><p>$SUBWAIT</p><p>$t_bul</p></fireRef>
	<fireRef label="enemy_fire_m02s"><p>90*$t_dir</p><p>1.0*$SPEED</p><p>$t_dir</p><p>$OFFSETDIR</p><p>$SUBWAIT</p><p>$t_bul</p></fireRef>
	<fireRef label="enemy_fire_m02s"><p>90*$t_dir</p><p>0.8*$SPEED</p><p>-1*$t_dir</p><p>$OFFSETDIR</p><p>$SUBWAIT</p><p>$t_bul</p></fireRef>
	<w>8</w>
	
	<repeat><times>5</times>
		<evalAdd name="OFFSETDIR">$t_dir*360/72</evalAdd>
		<evalAdd name="SUBWAIT">1</evalAdd>
		<fireRef label="enemy_fire_m02s"><p>(90+17.0)*$t_dir</p><p>$SPEED</p><p>$t_dir</p><p>$OFFSETDIR</p><p>$SUBWAIT</p><p>$t_bul</p></fireRef>
		<fireRef label="enemy_fire_m02s"><p>90*$t_dir</p><p>0.8*$SPEED</p><p>-1*$t_dir</p><p>$OFFSETDIR</p><p>$SUBWAIT</p><p>$t_bul</p></fireRef>
		<fireRef label="enemy_fire_m02s"><p>90*$t_dir</p><p>1.0*$SPEED</p><p>$t_dir</p><p>$OFFSETDIR</p><p>$SUBWAIT</p><p>$t_bul</p></fireRef>
		<fireRef label="enemy_fire_m02s"><p>90*$t_dir</p><p>0.8*$SPEED</p><p>-1*$t_dir</p><p>$OFFSETDIR</p><p>$SUBWAIT</p><p>$t_bul</p></fireRef>
		<wait>8</wait>
	</repeat>

	<repeat><times>2</times>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<repeat><times>6</times>
		<evalAdd name="OFFSETDIR">$t_dir*360/72</evalAdd>
		<evalAdd name="SUBWAIT">1</evalAdd>
		<fireRef label="enemy_fire_m02s"><p>(90+17.0)*$t_dir</p><p>$SPEED</p><p>$t_dir</p><p>$OFFSETDIR</p><p>$SUBWAIT</p><p>$t_bul</p></fireRef>
		<fireRef label="enemy_fire_m02s"><p>90*$t_dir</p><p>0.8*$SPEED</p><p>-1*$t_dir</p><p>$OFFSETDIR</p><p>$SUBWAIT</p><p>$t_bul</p></fireRef>
		<fireRef label="enemy_fire_m02s"><p>90*$t_dir</p><p>1.0*$SPEED</p><p>$t_dir</p><p>$OFFSETDIR</p><p>$SUBWAIT</p><p>$t_bul</p></fireRef>
		<fireRef label="enemy_fire_m02s"><p>90*$t_dir</p><p>0.8*$SPEED</p><p>-1*$t_dir</p><p>$OFFSETDIR</p><p>$SUBWAIT</p><p>$t_bul</p></fireRef>
		<wait>8</wait>
	</repeat>
	</repeat>

	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<repeat><times>6</times>
		<fireRef label="enemy_fire_m02_2s"><p>(90+17.0)*$t_dir</p><p>$SPEED</p></fireRef>
		<fireRef label="enemy_fire_m02_2s"><p>90*$t_dir</p><p>0.8*$SPEED</p></fireRef>
		<fireRef label="enemy_fire_m02_2s"><p>90*$t_dir</p><p>1.0*$SPEED</p></fireRef>
		<fireRef label="enemy_fire_m02_2s"><p>90*$t_dir</p><p>0.8*$SPEED</p></fireRef>
		<wait>8</wait>
	</repeat>

</a>

<a l="middle_boss_02_1_act01">

	<eval name="SPEED">3.6+($__temp_grank*0.05)</eval>
	<eval name="t_bul">3</eval>
	<eval name="t_dir">1-2*($_player_cx-lt400)</eval>
	<eval name="OFFSETDIR">180</eval>
	<eval name="SUBWAIT">40</eval>
	<w>1</w>

	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fireRef label="enemy_fire_m02"><p>0</p><p>$SPEED</p><p>$t_dir</p><p>$OFFSETDIR</p><p>$SUBWAIT</p><p>$t_bul</p></fireRef>
	<fireRef label="enemy_fire_m02s"><p>90*$t_dir</p><p>0.8*$SPEED</p><p>-1*$t_dir</p><p>$OFFSETDIR</p><p>$SUBWAIT</p><p>$t_bul</p></fireRef>
	<fireRef label="enemy_fire_m02s"><p>90*$t_dir</p><p>1.0*$SPEED</p><p>$t_dir</p><p>$OFFSETDIR</p><p>$SUBWAIT</p><p>$t_bul</p></fireRef>
	<fireRef label="enemy_fire_m02s"><p>90*$t_dir</p><p>0.8*$SPEED</p><p>-1*$t_dir</p><p>$OFFSETDIR</p><p>$SUBWAIT</p><p>$t_bul</p></fireRef>
	<w>7</w>
	
	<repeat><times>4</times>
		<evalAdd name="OFFSETDIR">$t_dir*360/80</evalAdd>
		<evalAdd name="SUBWAIT">1</evalAdd>
		<fireRef label="enemy_fire_m02s"><p>(90+17)*$t_dir</p><p>$SPEED</p><p>$t_dir</p><p>$OFFSETDIR</p><p>$SUBWAIT</p><p>$t_bul</p></fireRef>
		<fireRef label="enemy_fire_m02s"><p>90*$t_dir</p><p>0.8*$SPEED</p><p>-1*$t_dir</p><p>$OFFSETDIR</p><p>$SUBWAIT</p><p>$t_bul</p></fireRef>
		<fireRef label="enemy_fire_m02s"><p>90*$t_dir</p><p>1.0*$SPEED</p><p>$t_dir</p><p>$OFFSETDIR</p><p>$SUBWAIT</p><p>$t_bul</p></fireRef>
		<fireRef label="enemy_fire_m02s"><p>90*$t_dir</p><p>0.8*$SPEED</p><p>-1*$t_dir</p><p>$OFFSETDIR</p><p>$SUBWAIT</p><p>$t_bul</p></fireRef>
		<wait>7</wait>
	</repeat>

	<repeat><times>3</times>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<repeat><times>5</times>
		<evalAdd name="OFFSETDIR">$t_dir*360/80</evalAdd>
		<evalAdd name="SUBWAIT">1</evalAdd>
		<fireRef label="enemy_fire_m02s"><p>(90+17)*$t_dir</p><p>$SPEED</p><p>$t_dir</p><p>$OFFSETDIR</p><p>$SUBWAIT</p><p>$t_bul</p></fireRef>
		<fireRef label="enemy_fire_m02s"><p>90*$t_dir</p><p>0.8*$SPEED</p><p>-1*$t_dir</p><p>$OFFSETDIR</p><p>$SUBWAIT</p><p>$t_bul</p></fireRef>
		<fireRef label="enemy_fire_m02s"><p>90*$t_dir</p><p>1.0*$SPEED</p><p>$t_dir</p><p>$OFFSETDIR</p><p>$SUBWAIT</p><p>$t_bul</p></fireRef>
		<fireRef label="enemy_fire_m02s"><p>90*$t_dir</p><p>0.8*$SPEED</p><p>-1*$t_dir</p><p>$OFFSETDIR</p><p>$SUBWAIT</p><p>$t_bul</p></fireRef>
		<wait>7</wait>
	</repeat>
	</repeat>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<repeat><times>11</times>
		<fireRef label="enemy_fire_m02_2s"><p>(90+8.5)*$t_dir</p><p>$SPEED</p></fireRef>
		<fireRef label="enemy_fire_m02_2s"><p>90*$t_dir</p><p>0.8*$SPEED</p></fireRef>
		<fireRef label="enemy_fire_m02_2s"><p>90*$t_dir</p><p>1.0*$SPEED</p></fireRef>
		<fireRef label="enemy_fire_m02_2s"><p>90*$t_dir</p><p>0.8*$SPEED</p></fireRef>
		<wait>3</wait>
	</repeat>
	<w>19</w>

</a>

<a l="middle_boss_02_1_act02">

	<eval name="SPEED">3.9+($__temp_grank*0.05)</eval>
	<eval name="t_bul">4</eval>
	<eval name="t_dir">1-2*($_player_cx-lt400)</eval>
	<eval name="OFFSETDIR">180</eval>
	<eval name="SUBWAIT">22</eval>
	<w>1</w>

	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fireRef label="enemy_fire_m02"><p>0</p><p>$SPEED</p><p>$t_dir</p><p>$OFFSETDIR</p><p>$SUBWAIT</p><p>$t_bul</p></fireRef>
	<fireRef label="enemy_fire_m02s"><p>90*$t_dir</p><p>0.8*$SPEED</p><p>-1*$t_dir</p><p>$OFFSETDIR</p><p>$SUBWAIT</p><p>$t_bul</p></fireRef>
	<fireRef label="enemy_fire_m02s"><p>90*$t_dir</p><p>1.0*$SPEED</p><p>$t_dir</p><p>$OFFSETDIR</p><p>$SUBWAIT</p><p>$t_bul</p></fireRef>
	<fireRef label="enemy_fire_m02s"><p>90*$t_dir</p><p>0.8*$SPEED</p><p>-1*$t_dir</p><p>$OFFSETDIR</p><p>$SUBWAIT</p><p>$t_bul</p></fireRef>
	<w>7</w>
	
	<repeat><times>4</times>
		<evalAdd name="OFFSETDIR">$t_dir*360/80</evalAdd>
		<evalAdd name="SUBWAIT">1</evalAdd>
		<fireRef label="enemy_fire_m02s"><p>(90+13)*$t_dir</p><p>$SPEED</p><p>$t_dir</p><p>$OFFSETDIR</p><p>$SUBWAIT</p><p>$t_bul</p></fireRef>
		<fireRef label="enemy_fire_m02s"><p>90*$t_dir</p><p>0.8*$SPEED</p><p>-1*$t_dir</p><p>$OFFSETDIR</p><p>$SUBWAIT</p><p>$t_bul</p></fireRef>
		<fireRef label="enemy_fire_m02s"><p>90*$t_dir</p><p>1.0*$SPEED</p><p>$t_dir</p><p>$OFFSETDIR</p><p>$SUBWAIT</p><p>$t_bul</p></fireRef>
		<fireRef label="enemy_fire_m02s"><p>90*$t_dir</p><p>0.8*$SPEED</p><p>-1*$t_dir</p><p>$OFFSETDIR</p><p>$SUBWAIT</p><p>$t_bul</p></fireRef>
		<wait>7</wait>
	</repeat>

	<repeat><times>3</times>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<repeat><times>5</times>
		<evalAdd name="OFFSETDIR">$t_dir*360/80</evalAdd>
		<evalAdd name="SUBWAIT">1</evalAdd>
		<fireRef label="enemy_fire_m02s"><p>(90+13)*$t_dir</p><p>$SPEED</p><p>$t_dir</p><p>$OFFSETDIR</p><p>$SUBWAIT</p><p>$t_bul</p></fireRef>
		<fireRef label="enemy_fire_m02s"><p>90*$t_dir</p><p>0.8*$SPEED</p><p>-1*$t_dir</p><p>$OFFSETDIR</p><p>$SUBWAIT</p><p>$t_bul</p></fireRef>
		<fireRef label="enemy_fire_m02s"><p>90*$t_dir</p><p>1.0*$SPEED</p><p>$t_dir</p><p>$OFFSETDIR</p><p>$SUBWAIT</p><p>$t_bul</p></fireRef>
		<fireRef label="enemy_fire_m02s"><p>90*$t_dir</p><p>0.8*$SPEED</p><p>-1*$t_dir</p><p>$OFFSETDIR</p><p>$SUBWAIT</p><p>$t_bul</p></fireRef>
		<wait>7</wait>
	</repeat>
	</repeat>

	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<repeat><times>16</times>
		<fireRef label="enemy_fire_m02_2s"><p>(90+6.2)*$t_dir</p><p>$SPEED+0.2</p></fireRef>
		<fireRef label="enemy_fire_m02_2s"><p>90*$t_dir</p><p>$SPEED+0.2</p></fireRef>
		<fireRef label="enemy_fire_m02_2s"><p>90*$t_dir</p><p>$SPEED+0.2</p></fireRef>
		<fireRef label="enemy_fire_m02_2s"><p>90*$t_dir</p><p>$SPEED+0.2</p></fireRef>
		<wait>3</wait>
	</repeat>
	<w>4</w>

</a>



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

<revenge label="stage_middle_boss_01_revenge">
	<actionRef l="enemy_explosion_create_action_03"></actionRef>

	<!-- ナノマシン、クリスタル、速攻値 -->
	<!-- スコア初期化 -->
	<eval name="localcounter">$_counter-$__counter_tmp</eval>
	<repeat><times>$localcounter-gt$1</times>
		<eval name="localcounter">$1</eval>
	</repeat>
	<eval name="nano">30</eval>
	<eval name="score_dat">0</eval>

	<eval name="percent">0</eval>
	<eval name="crystal_num">12</eval>

	<debugval><num>$_counter</num></debugval>
	<debugval><num>$localcounter</num></debugval>

	<changeSpeed>
		<speed>0</speed><tm>1</tm>
	</changeSpeed>
	<changeColor>
		<alpha>255</alpha><red>255</red><green>255</green><blue>255</blue><term>1</term>
	</changeColor>
	<w>1</w>

	<!-- 爆発アクション -->
<!-- 未実装 -->
<!--
	<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>
	<wait>1</wait>


	<!-- *** スコア加算 *** -->
	<!-- *** 弾幕のアイテム化 *** -->
	<repeat><times>$_revenge_state-eq1</times>
		<eval name="percent">1-($localcounter/$1)</eval>
		<eval name="score_dat">(($2*$percent)%30000000)</eval>
		<actionRef l="boss_score_add_action"><p>$3</p><p>$score_dat</p></actionRef>

		<!-- クリスタル -->
		<repeat><times>(($percent*100)-lt70)</times>
			<eval name="crystal_num">((($percent*20)%100)-2)*(($percent*100)-gt10)</eval>
		</repeat>
		<eval name="crystal_num">$crystal_num+($__grank-gt0)</eval>

		<cRef label="timer_per_fig_action_create"><p>$2</p><p>$percent*10000</p></cRef>
		<cRef label="crystal_fig_action_create"><p>$crystal_num</p></cRef>
		<wait>1</wait>
		<changeBulletToItem/>
	</repeat>
	<repeat><times>$_revenge_state-eq3</times>
		<cRef label="timer_per_fig_action_create"><p>$2</p><p>0</p></cRef>
		<wait>1</wait>
		<create>
			<speed>0</speed><direction>0</direction>
			<cx>400</cx><cy>300</cy><vital>0</vital>
			<bombRef label="bomb_clearbomb"></bombRef>
		</create>
	</repeat>

	<debugval><num>$percent</num></debugval>
	<debugval><num>$score_dat</num></debugval>

	<!-- *** アイテムの出現 *** -->
	<repeat><times>$_revenge_state-eq1</times>

		<!-- ナノマシン -->
		<eval name="temp_x">($_self_cx-5+($_self_cy%11))%90</eval>
		<repeat><times>$nano</times>
			<w>1</w>
			<createRef label="item_create_02_big"><p>$temp_x</p></createRef>
			<createRef label="item_create_02_big"><p>$temp_x/2</p></createRef>
			<createRef label="item_create_02_big"><p>$temp_x*2</p></createRef>
			<createRef label="item_create_02_big"><p>$temp_x*3</p></createRef>
			<evaladd name="temp_x">($temp_x+3)%7</evaladd>
		</repeat>

		<debugval><num>$crystal_num</num></debugval>

		<aRef l="boss_item"><p>$crystal_num</p></aRef>

	</repeat>
<!--
	<repeat><times>$_revenge_state-eq3</times>
		<addRank><num>-100000</num></addRank>
	</repeat>
-->
	<wait>60</wait>

	<!-- *** 次の形態のボスの作成 *** -->
	<createRef label="enemy_create_middle_boss">
		<p>$_self_cx</p><p>$_self_cy</p><p>12000</p><p>900</p><p>2600+200*$_difficulty+$score_dat</p><p>500000</p>
	</createRef>

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

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

<revenge label="stage_middle_boss_02_revenge">
	<actionRef l="enemy_explosion_create_action_04"></actionRef>



	<!-- ナノマシン、クリスタル、速攻値 -->
	<!-- スコア初期化 -->
	<eval name="localcounter">$_counter-$__counter_tmp</eval>
	<repeat><times>$localcounter-gt$1</times>
		<eval name="localcounter">$1</eval>
	</repeat>
	<eval name="nano">32</eval>
	<eval name="score_dat">0</eval>
	<eval name="percent">0</eval>
	<eval name="crystal_num">12</eval>
	<debugval><num>$_counter</num></debugval>
	<debugval><num>$localcounter</num></debugval>

	<changeSpeed>
		<speed>0</speed><tm>1</tm>
	</changeSpeed>
	<changeColor>
		<alpha>255</alpha><red>255</red><green>255</green><blue>255</blue><term>1</term>
	</changeColor>
	<w>1</w>

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

	<!-- *** スコア加算 *** -->
	<!-- *** 弾幕のアイテム化 or 自爆で弾消 *** -->
	<repeat><times>$_revenge_state-eq1</times>
		<eval name="percent">1-($localcounter/$1)</eval>
		<eval name="score_dat">(($2*$percent)%30000000)</eval>
		<actionRef l="boss_score_add_action"><p>$3</p><p>$score_dat</p></actionRef>
		<!-- クリスタル -->
		<repeat><times>(($percent*100)-lt70)</times>
			<eval name="crystal_num">((($percent*20)%100)-2)*(($percent*100)-gt10)</eval>
		</repeat>
		<eval name="crystal_num">$crystal_num+($__grank-gt0)</eval>

		<cRef label="timer_per_fig_action_create"><p>$2</p><p>$percent*10000</p></cRef>
		<cRef label="crystal_fig_action_create"><p>$crystal_num</p></cRef>
		<wait>1</wait>
		<changeBulletToItem/>
	</repeat>
	<repeat><times>$_revenge_state-eq3</times>
		<cRef label="timer_per_fig_action_create"><p>$2</p><p>0</p></cRef>
		<wait>1</wait>
		<create>
			<speed>0</speed><direction>0</direction>
			<cx>400</cx><cy>300</cy><vital>0</vital>
			<bombRef label="bomb_clearbomb"></bombRef>
		</create>
	</repeat>

	<debugval><num>$percent</num></debugval>
	<debugval><num>$score_dat</num></debugval>

	<wait>1</wait>

	<!-- *** アイテムの出現 *** -->
	<repeat><times>$_revenge_state-eq1</times>

		<!-- ナノマシン -->
		<eval name="temp_x">($_self_cx-5+($_self_cy%11))%90</eval>
		<repeat><times>$nano</times>
			<w>1</w>
			<createRef label="item_create_02_big"><p>$temp_x</p></createRef>
			<createRef label="item_create_02_big"><p>$temp_x/2</p></createRef>
			<createRef label="item_create_02_big"><p>$temp_x*2</p></createRef>
			<createRef label="item_create_02_big"><p>$temp_x*3</p></createRef>
			<evaladd name="temp_x">($temp_x+3)%7</evaladd>
		</repeat>

		<debugval><num>$crystal_num</num></debugval>

		<aRef l="boss_item"><p>$crystal_num</p></aRef>

	</repeat>
<!--
	<repeat><times>$_revenge_state-eq3</times>
		<addRank><num>-100000</num></addRank>
	</repeat>
-->
	<wait>60</wait>

	<!-- *** 終了アクションへ *** -->
	<actionRef label="stage_middle_boss_final_revenge_action"></actionRef>
</revenge>


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

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

<!-- 未実装
	<targetRevenge label="namebox"></targetRevenge>
	<actionRef l="bg_midbossend_action"></actionRef>
-->

	<!-- テンションアップ -->
	<createRef label="item_create_03"><p>45</p></createRef>

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

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

	
</exbulletml>
