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

<!-- ********************************************************************* -->
<!-- *** 中ボス present                                                *** -->
<!-- ***                                                               *** -->
<present label="stage_middle_boss_present_01">
	<damageRef l="enemy_common_damage"></damageRef>
	<img type="normal">
		<file type="dds">shizukuishi_dot_sample</file>
		<left>12</left><top>0</top><right>52</right><bottom>64</bottom>
		<width>40</width><height>64</height>
		<alpha>255</alpha><red>255</red><green>255</green><blue>255</blue>
	</img>
	<create>
			<cx>$_self_cx</cx><cy>$_self_cy-2</cy><speed>0</speed><dir>0</dir>
			<child>1</child>
			<dobject>
				<definedAction type="synctoparentx"></definedAction>
				<definedAction type="synctoparenty"></definedAction>
				<img type="add">
					<file type="dds">shizukuishi_dot_sample</file>
					<left>0</left><top>64</top><right>64</right><bottom>128</bottom>
					<width>64</width><height>64</height>
					<alpha>255</alpha><red>255</red><green>255</green><blue>255</blue>
				</img>
				<setDrawLevel><num>14</num></setDrawLevel>

				<global n="boss_revenge_present_flag">0</global>
				<rep><ts>-1</ts>
					<rep><ts>$__boss_revenge_present_flag</ts>
						<changeColor>
							<alpha>40</alpha><red>255</red><green>255</green><blue>255</blue><term>110</term>
						</changeColor>
						<vanish></vanish>
					</rep>

					<changeColor><alpha>64</alpha><red>255</red><green>255</green><blue>255</blue><term>2</term></changeColor>
					<wait>2</wait>
					<changeColor><alpha>255</alpha><red>255</red><green>255</green><blue>255</blue><term>2</term></changeColor>
					<wait>2</wait>
				</rep>			

			</dobject>
	</create>

	<eval n="animcnt">0</eval>
	<rep><ts>-1</ts>
		

		<rep><ts>$_self_vx-eq0</ts>

			<rep><ts>$animcnt-eq0</ts><setImgUV><left>12+64*0</left><top>0</top><right>52+64*0</right><bottom>64</bottom></setImgUV></rep>
			<rep><ts>$animcnt-eq1</ts><setImgUV><left>12+64*1</left><top>0</top><right>52+64*1</right><bottom>64</bottom></setImgUV></rep>
			<rep><ts>$animcnt-eq2</ts><setImgUV><left>12+64*2</left><top>0</top><right>52+64*2</right><bottom>64</bottom></setImgUV></rep>
			<rep><ts>$animcnt-eq3</ts><setImgUV><left>12+64*3</left><top>0</top><right>52+64*3</right><bottom>64</bottom></setImgUV></rep>
			<rep><ts>$animcnt-eq4</ts><setImgUV><left>12+64*2</left><top>0</top><right>52+64*2</right><bottom>64</bottom></setImgUV></rep>
			<rep><ts>$animcnt-eq5</ts><setImgUV><left>12+64*1</left><top>0</top><right>52+64*1</right><bottom>64</bottom></setImgUV></rep>
		</rep>

		<rep><ts>$_self_vx-gt0</ts>
			<setImgUV><left>12+64*1</left><top>64</top><right>52+64*1</right><bottom>128</bottom></setImgUV>
		</rep>
		<rep><ts>$_self_vx-lt0</ts>
			<setImgUV><left>12+64*2</left><top>64</top><right>52+64*2</right><bottom>128</bottom></setImgUV>
		</rep>


		<eval n="animcnt">($animcnt+1)%6</eval>
		<wait>8</wait>
	</rep>

</present>


<present label="stage_middle_boss_revnege_present_01">
	<changeColor>
		<alpha>40</alpha><red>255</red><green>255</green><blue>255</blue><term>120</term>
	</changeColor>
	<global n="middle_boss_revenge_present_flag">1</global>

</present>


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

<action label="stage_middle_boss_action">

	<!-- *** 第 N 形態 *** -->
	<global name="boss_state">1</global>
	
	<!-- *** ボスの初期ライフ *** -->
	<global name="boss_life">3</global>
	
	<!-- 結奈先輩用global -->
	<global name="laser_dir">0</global>
	<global name="bul_dir">0</global>

	<!-- *** 会話終了ロックをかける *** -->
	<setLock><num>11</num></setLock>

	<!-- *** 最初のボスオブジェクト作成 *** -->
	<global name="temp_grank">$__grank</global>

	<!-- ｘ座標、y座標、体力、inv、スコア、侵食率 -->
	<createRef label="enemy_create_middle_boss">
		<p>320</p>
		<p>-12</p>
		<p>17000+$__temp_grank*600</p>
		<p>0</p>
		<p>200000+$__temp_grank*2000</p>
		<p>$__middle_boss_prate</p>
	</createRef>

	<w>60</w>
</action>

<action label="stage_middle_boss_start">

	<!-- *** 会話終了ロック解除 *** -->
	<releaseLock><num>11</num></releaseLock>

	<!-- *** ボスの名称表示オブジェクト作成 *** -->
	<!--
	<createRef label="boss_name_stage_main"></createRef>	
	-->

	<sound type="bgm" label="bgm">
		<track><file type="ogg">19_lastmboss_loop</file></track>
		<play><flag>1</flag><loop>44100*2*2*5</loop></play>
	</sound>
	<actionRef label="stageG_3_bgm_title_action"/>


	<!-- *** ボスのライフ表示オブジェクト作成 *** -->
	<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>

	<!-- *** 第 1 形態以外の場合に VITAL ゲージを作成 *** -->
	<rep><ts>1-($__boss_state-eq1)</ts>
		<!-- *** VITAL ゲージはボスの子オブジェクトなのでここで作成 *** -->
		<createRef label="boss_vital_create"></createRef>

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

	<!-- タイマー差分初期化 -->
	<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">110</eval>
		<revengeRef label="stage_middle_boss_01_revenge"><p>$cross_over</p></revengeRef>
		<actionRef  label="stage_middle_boss_01_action"><p>$cross_over</p></actionRef> 
<!--
		<global name="timer">12</global>
		<global name="timerwait">230</global>
		<actionRef  label="create_timer0"></actionRef>
-->
	</repeat>

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

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

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

		<global name="timer">12</global>
		<global name="timerwait">235</global>
		<actionRef  label="stage_middle_boss_03_action"><p>$cross_over</p></actionRef> 
	</repeat>
	<repeat><times>$__boss_state-eq4</times>
		<aRef l="p_avrage_add"/>
		<eval name="cross_over">110</eval>
		<revengeRef label="stage_middle_boss_04_revenge"><p>$cross_over</p></revengeRef>

		<global name="timer">13</global>
		<global name="timerwait">320</global>
		<actionRef  label="stage_middle_boss_04_action"><p>$cross_over</p></actionRef> 
	</repeat>
	<repeat><times>$__boss_state-eq5</times>
		<aRef l="p_avrage_add"/>
		<eval name="cross_over">110</eval>
		<revengeRef label="stage_middle_boss_05_revenge"><p>$cross_over</p></revengeRef>

		<global name="timer">13</global>
		<global name="timerwait">320</global>
		<actionRef  label="stage_middle_boss_05_action"><p>$cross_over</p></actionRef> 
	</repeat>

</enemy>


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

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


	<changeSpeed>
		<speed>0</speed><tm>30</tm>
	</changeSpeed>
	<wait>40</wait>

	<!-- *** 会話終了待ち *** -->
	<waitLock><num>11</num></waitLock>

	<!-- *** 第 1 形態に限りゲージ類をここで作成 *** -->
	<createRef label="boss_vital_create"></createRef>
	<createRef label="boss_underbar_create"></createRef>
	<global name="timer">12</global>
	<global name="timerwait">280</global>

	<wait>30</wait>

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

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

<repeat><times>5</times>

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

	<eval name="trank">$__temp_grank</eval>
	<repeat><times>$trank-eq0</times>
		<actionRef label="stageG_bossTmp01_subAct0"/>
	</repeat>
	<repeat><times>$trank-eq1</times>
		<actionRef label="stageG_bossTmp01_subAct1"/>
	</repeat>
	<repeat><times>$trank-eq2</times>
		<actionRef label="stageG_bossTmp01_subAct2"/>
	</repeat>
	<repeat><times>$trank-eq3</times>
		<actionRef label="stageG_bossTmp01_subAct3"/>
	</repeat>
	<repeat><times>$trank-eq4</times>
		<actionRef label="stageG_bossTmp01_subAct4"/>
	</repeat>
	<repeat><times>$trank-eq5</times>
		<actionRef label="stageG_bossTmp01_subAct5"/>
	</repeat>

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

	<!-- 難易度調整中にもあり -->
	<actionRef label="stageG_bossTmp02_subAct2"/>


	<w>30</w>
	<actionRef label="boss_rand_move02"></actionRef>
	<w>40</w>

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

</repeat>
<global name="end_flag">1</global>

</action>


<action label="stageG_bossTmp01_subAct0">
	<eval name="WAIT">15</eval>
	<eval name="sp">1.7</eval>
	<w>1</w>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fireRef label="stageG_bosstmp02_fire00A">
	<p>0</p><p>$sp</p><p>$WAIT</p>
	</fireRef>
	<fireRef label="stageG_bosstmp02_fire00B">
	<p>360/48</p><p>$sp*0.75</p><p>$WAIT</p>
	</fireRef>
	<fireRef label="stageG_bosstmp02_fire00B">
	<p>360/48</p><p>$sp*0.5</p><p>$WAIT</p>
	</fireRef>
	<fireRef label="stageG_bosstmp02_fire00B">
	<p>360/48</p><p>$sp*0.25</p><p>$WAIT</p>
	</fireRef>
	<repeat><times>11</times>
		<wait>1</wait>
		<evalAdd name="WAIT">-1</evalAdd>
		<fireRef label="stageG_bosstmp02_fire00B">
		<p>360/48</p><p>$sp</p><p>$WAIT</p>
		</fireRef>
		<fireRef label="stageG_bosstmp02_fire00B">
		<p>360/48</p><p>$sp*0.75</p><p>$WAIT</p>
		</fireRef>
		<fireRef label="stageG_bosstmp02_fire00B">
		<p>360/48</p><p>$sp*0.5</p><p>$WAIT</p>
		</fireRef>
		<fireRef label="stageG_bosstmp02_fire00B">
		<p>360/48</p><p>$sp*0.25</p><p>$WAIT</p>
		</fireRef>
	</repeat>
	<w>38</w>
</action>

<action label="stageG_bossTmp01_subAct1">
	<eval name="WAIT">15</eval>
	<eval name="sp">1.8</eval>
	<w>1</w>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fireRef label="stageG_bosstmp02_fire00A">
	<p>0</p><p>$sp</p><p>$WAIT</p>
	</fireRef>
	<fireRef label="stageG_bosstmp02_fire00B">
	<p>360/60</p><p>$sp*0.75</p><p>$WAIT</p>
	</fireRef>
	<fireRef label="stageG_bosstmp02_fire00B">
	<p>360/60</p><p>$sp*0.5</p><p>$WAIT</p>
	</fireRef>
	<fireRef label="stageG_bosstmp02_fire00B">
	<p>360/60</p><p>$sp*0.25</p><p>$WAIT</p>
	</fireRef>
	<repeat><times>14</times>
		<wait>1</wait>
		<evalAdd name="WAIT">-1</evalAdd>
		<fireRef label="stageG_bosstmp02_fire00B">
		<p>360/60</p><p>$sp</p><p>$WAIT</p>
		</fireRef>
		<fireRef label="stageG_bosstmp02_fire00B">
		<p>360/60</p><p>$sp*0.75</p><p>$WAIT</p>
		</fireRef>
		<fireRef label="stageG_bosstmp02_fire00B">
		<p>360/60</p><p>$sp*0.5</p><p>$WAIT</p>
		</fireRef>
		<fireRef label="stageG_bosstmp02_fire00B">
		<p>360/60</p><p>$sp*0.25</p><p>$WAIT</p>
		</fireRef>
	</repeat>
	<w>35</w>
</action>

<action label="stageG_bossTmp01_subAct2">
	<eval name="WAIT">18</eval>
	<eval name="sp">1.9</eval>
	<w>1</w>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fireRef label="stageG_bosstmp02_fire00A">
	<p>0</p><p>$sp</p><p>$WAIT</p>
	</fireRef>
	<fireRef label="stageG_bosstmp02_fire00B">
	<p>360/72</p><p>$sp*0.75</p><p>$WAIT</p>
	</fireRef>
	<fireRef label="stageG_bosstmp02_fire00B">
	<p>360/72</p><p>$sp*0.5</p><p>$WAIT</p>
	</fireRef>
	<fireRef label="stageG_bosstmp02_fire00B">
	<p>360/72</p><p>$sp*0.25</p><p>$WAIT</p>
	</fireRef>
	<repeat><times>17</times>
		<wait>1</wait>
		<evalAdd name="WAIT">-1</evalAdd>
		<fireRef label="stageG_bosstmp02_fire00B">
		<p>360/72</p><p>$sp</p><p>$WAIT</p>
		</fireRef>
		<fireRef label="stageG_bosstmp02_fire00B">
		<p>360/72</p><p>$sp*0.75</p><p>$WAIT</p>
		</fireRef>
		<fireRef label="stageG_bosstmp02_fire00B">
		<p>360/72</p><p>$sp*0.5</p><p>$WAIT</p>
		</fireRef>
		<fireRef label="stageG_bosstmp02_fire00B">
		<p>360/72</p><p>$sp*0.25</p><p>$WAIT</p>
		</fireRef>
	</repeat>
	<w>32</w>
</action>

<action label="stageG_bossTmp01_subAct3">
	<eval name="WAIT">20</eval>
	<eval name="sp">2.0</eval>
	<w>1</w>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fireRef label="stageG_bosstmp02_fire00A">
	<p>0</p><p>$sp</p><p>$WAIT</p>
	</fireRef>
	<fireRef label="stageG_bosstmp02_fire00B">
	<p>360/80</p><p>$sp-0.5</p><p>$WAIT</p>
	</fireRef>
	<fireRef label="stageG_bosstmp02_fire00B">
	<p>360/80</p><p>$sp-1.0</p><p>$WAIT</p>
	</fireRef>
	<fireRef label="stageG_bosstmp02_fire00B">
	<p>360/80</p><p>$sp-1.5</p><p>$WAIT</p>
	</fireRef>
	<repeat><times>19</times>
		<wait>1</wait>
		<evalAdd name="WAIT">-1</evalAdd>
		<fireRef label="stageG_bosstmp02_fire00B">
		<p>360/80</p><p>$sp</p><p>$WAIT</p>
		</fireRef>
		<fireRef label="stageG_bosstmp02_fire00B">
		<p>360/80</p><p>$sp-0.5</p><p>$WAIT</p>
		</fireRef>
		<fireRef label="stageG_bosstmp02_fire00B">
		<p>360/80</p><p>$sp-1.0</p><p>$WAIT</p>
		</fireRef>
		<fireRef label="stageG_bosstmp02_fire00B">
		<p>360/80</p><p>$sp-1.5</p><p>$WAIT</p>
		</fireRef>
	</repeat>
	<w>30</w>
</action>
<!--
<action label="stageG_bossTmp01_subAct3">
	<eval name="WAIT">22</eval>
	<eval name="sp">2.2</eval>
	<w>1</w>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fireRef label="stageG_bosstmp02_fire00A">
	<p>0</p><p>$sp</p><p>$WAIT</p>
	</fireRef>
	<fireRef label="stageG_bosstmp02_fire00B">
	<p>360/88</p><p>$sp-0.5</p><p>$WAIT</p>
	</fireRef>
	<fireRef label="stageG_bosstmp02_fire00B">
	<p>360/88</p><p>$sp-1.0</p><p>$WAIT</p>
	</fireRef>
	<fireRef label="stageG_bosstmp02_fire00B">
	<p>360/88</p><p>$sp-1.5</p><p>$WAIT</p>
	</fireRef>
	<repeat><times>21</times>
		<wait>1</wait>
		<evalAdd name="WAIT">-1</evalAdd>
		<fireRef label="stageG_bosstmp02_fire00B">
		<p>360/88</p><p>$sp</p><p>$WAIT</p>
		</fireRef>
		<fireRef label="stageG_bosstmp02_fire00B">
		<p>360/88</p><p>$sp-0.5</p><p>$WAIT</p>
		</fireRef>
		<fireRef label="stageG_bosstmp02_fire00B">
		<p>360/88</p><p>$sp-1.0</p><p>$WAIT</p>
		</fireRef>
		<fireRef label="stageG_bosstmp02_fire00B">
		<p>360/88</p><p>$sp-1.5</p><p>$WAIT</p>
		</fireRef>
	</repeat>
	<w>28</w>
</action>
-->
<action label="stageG_bossTmp01_subAct4">
	<eval name="WAIT">26</eval>
	<eval name="sp">2.4</eval>
	<w>1</w>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fireRef label="stageG_bosstmp02_fire00A">
	<p>0</p><p>$sp</p><p>$WAIT</p>
	</fireRef>
	<fireRef label="stageG_bosstmp02_fire00B">
	<p>360/130</p><p>$sp-0.6</p><p>$WAIT</p>
	</fireRef>
	<fireRef label="stageG_bosstmp02_fire00B">
	<p>360/130</p><p>$sp-1.0</p><p>$WAIT</p>
	</fireRef>
	<fireRef label="stageG_bosstmp02_fire00B">
	<p>360/130</p><p>$sp-1.4</p><p>$WAIT</p>
	</fireRef>
	<fireRef label="stageG_bosstmp02_fire00B">
	<p>360/130</p><p>$sp-1.8</p><p>$WAIT</p>
	</fireRef>
	<repeat><times>25</times>
		<wait>1</wait>
		<evalAdd name="WAIT">-1</evalAdd>
		<fireRef label="stageG_bosstmp02_fire00B">
		<p>360/130</p><p>$sp</p><p>$WAIT</p>
		</fireRef>
		<fireRef label="stageG_bosstmp02_fire00B">
		<p>360/130</p><p>$sp-0.6</p><p>$WAIT</p>
		</fireRef>
		<fireRef label="stageG_bosstmp02_fire00B">
		<p>360/130</p><p>$sp-1.0</p><p>$WAIT</p>
		</fireRef>
		<fireRef label="stageG_bosstmp02_fire00B">
		<p>360/130</p><p>$sp-1.4</p><p>$WAIT</p>
		</fireRef>
		<fireRef label="stageG_bosstmp02_fire00B">
		<p>360/130</p><p>$sp-1.8</p><p>$WAIT</p>
		</fireRef>
	</repeat>
	<w>36</w>
</action>



<action label="stageG_bossTmp01_subAct5">
	<eval name="WAIT">29</eval>
	<eval name="sp">2.7</eval>
	<w>1</w>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fireRef label="stageG_bosstmp02_fire00A">
	<p>0</p><p>$sp</p><p>$WAIT</p>
	</fireRef>
	<fireRef label="stageG_bosstmp02_fire00B">
	<p>360/145</p><p>$sp-0.7</p><p>$WAIT</p>
	</fireRef>
	<fireRef label="stageG_bosstmp02_fire00B">
	<p>360/145</p><p>$sp-1.1</p><p>$WAIT</p>
	</fireRef>
	<fireRef label="stageG_bosstmp02_fire00B">
	<p>360/145</p><p>$sp-1.5</p><p>$WAIT</p>
	</fireRef>
	<fireRef label="stageG_bosstmp02_fire00B">
	<p>360/145</p><p>$sp-1.9</p><p>$WAIT</p>
	</fireRef>
	<repeat><times>28</times>
		<wait>1</wait>
		<evalAdd name="WAIT">-1</evalAdd>
		<fireRef label="stageG_bosstmp02_fire00B">
		<p>360/145</p><p>$sp</p><p>$WAIT</p>
		</fireRef>
		<fireRef label="stageG_bosstmp02_fire00B">
		<p>360/145</p><p>$sp-0.7</p><p>$WAIT</p>
		</fireRef>
		<fireRef label="stageG_bosstmp02_fire00B">
		<p>360/145</p><p>$sp-1.1</p><p>$WAIT</p>
		</fireRef>
		<fireRef label="stageG_bosstmp02_fire00B">
		<p>360/145</p><p>$sp-1.5</p><p>$WAIT</p>
		</fireRef>
		<fireRef label="stageG_bosstmp02_fire00B">
		<p>360/145</p><p>$sp-1.9</p><p>$WAIT</p>
		</fireRef>
	</repeat>
	<w>21</w>
</action>

<action label="stageG_bossTmp02_subAct2">

	<eval name="rp_tm">2</eval>
	<eval name="sp">1.5+($__temp_grank-gt2)*0.1+($__temp_grank-gt3)*0.1</eval>
	<eval name="dir">20+($__temp_grank-gt0)*5+($__temp_grank-gt1)*5+($__temp_grank-gt2)*2</eval>
	<eval name="bul_num">6+$__temp_grank+($__temp_grank-gt3)+($__temp_grank-gt4)</eval>
	<eval name="DIRECT2">30</eval>
	<eval name="SPDOFFSET">0.42-($__temp_grank*0.02)</eval>
	<w>1</w>
	<repeat><times>3</times>
		<eval name="DIRECT">$dir*($rp_tm+1)</eval>
		<evalAdd name="DIRECT2">45/6</evalAdd>

		<aRef l="enemy_bullet_action8"><p>64</p></aRef>
		<repeat><times>$rp_tm</times>
			<fireRef label="stageG_bossTmp02_fire01">
			<p>$DIRECT2</p><p>$sp</p><p>$DIRECT</p><p>$bul_num</p><p>$SPDOFFSET</p>
			</fireRef>
			<evalAdd name="DIRECT">-1*$dir</evalAdd>
		</repeat>
		<wait>20</wait>

		<repeat><times>$__temp_grank-gt3</times>
		<eval name="DIRECT">-1*$dir*($rp_tm+1)</eval>
		<aRef l="enemy_bullet_action8"><p>64</p></aRef>
		<repeat><times>$rp_tm</times>
			<fireRef label="stageG_bossTmp02_fire01">
			<p>$DIRECT2+5</p><p>$sp</p><p>$DIRECT</p><p>$bul_num</p><p>$SPDOFFSET</p>
			</fireRef>
			<evalAdd name="DIRECT">$dir</evalAdd>
		</repeat>
		</repeat>

		<wait>20</wait>
		<eval name="DIRECT">-1*$dir*($rp_tm+1)</eval>
		<aRef l="enemy_bullet_action8"><p>64</p></aRef>
		<repeat><times>$rp_tm</times>
			<fireRef label="stageG_bossTmp02_fire01">
			<p>-1*$DIRECT2</p><p>$sp</p><p>$DIRECT</p><p>$bul_num</p><p>$SPDOFFSET</p>
			</fireRef>
			<evalAdd name="DIRECT">$dir</evalAdd>
		</repeat>
		<wait>20</wait>
		<repeat><times>$__temp_grank-gt3</times>
		<eval name="DIRECT">-1*$dir*($rp_tm+1)</eval>
		<aRef l="enemy_bullet_action8"><p>64</p></aRef>
		<repeat><times>$rp_tm</times>
			<fireRef label="stageG_bossTmp02_fire01">
			<p>-1*$DIRECT-5</p><p>$sp</p><p>$DIRECT</p><p>$bul_num</p><p>$SPDOFFSET</p>
			</fireRef>
			<evalAdd name="DIRECT">$dir</evalAdd>
		</repeat>
		</repeat>

		<wait>20</wait>
	</repeat>

	<!-- 難易度調整用 -->
	<global name="temp_grank">$__grank</global>
	<repeat><times>3</times>
		<eval name="DIRECT">$dir*($rp_tm+1)</eval>
		<evalAdd name="DIRECT2">45/6</evalAdd>

		<aRef l="enemy_bullet_action8"><p>64</p></aRef>
		<repeat><times>$rp_tm</times>
			<fireRef label="stageG_bossTmp02_fire01">
			<p>$DIRECT2</p><p>$sp</p><p>$DIRECT</p><p>$bul_num</p><p>$SPDOFFSET</p>
			</fireRef>
			<evalAdd name="DIRECT">-1*$dir</evalAdd>
		</repeat>
		<wait>20</wait>

		<repeat><times>$__temp_grank-gt3</times>
		<eval name="DIRECT">-1*$dir*($rp_tm+1)</eval>
		<aRef l="enemy_bullet_action8"><p>64</p></aRef>
		<repeat><times>$rp_tm</times>
			<fireRef label="stageG_bossTmp02_fire01">
			<p>$DIRECT2+5</p><p>$sp</p><p>$DIRECT</p><p>$bul_num</p><p>$SPDOFFSET</p>
			</fireRef>
			<evalAdd name="DIRECT">$dir</evalAdd>
		</repeat>
		</repeat>

		<wait>20</wait>
		<eval name="DIRECT">-1*$dir*($rp_tm+1)</eval>
		<aRef l="enemy_bullet_action8"><p>64</p></aRef>
		<repeat><times>$rp_tm</times>
			<fireRef label="stageG_bossTmp02_fire01">
			<p>-1*$DIRECT2</p><p>$sp</p><p>$DIRECT</p><p>$bul_num</p><p>$SPDOFFSET</p>
			</fireRef>
			<evalAdd name="DIRECT">$dir</evalAdd>
		</repeat>
		<wait>20</wait>
		<repeat><times>$__temp_grank-gt3</times>
		<eval name="DIRECT">-1*$dir*($rp_tm+1)</eval>
		<aRef l="enemy_bullet_action8"><p>64</p></aRef>
		<repeat><times>$rp_tm</times>
			<fireRef label="stageG_bossTmp02_fire01">
			<p>-1*$DIRECT-5</p><p>$sp</p><p>$DIRECT</p><p>$bul_num</p><p>$SPDOFFSET</p>
			</fireRef>
			<evalAdd name="DIRECT">$dir</evalAdd>
		</repeat>
		</repeat>

		<wait>20</wait>
	</repeat>

</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>60</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="white_boss_ring"><p>$1</p></createRef>

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

	<wait>1</wait>

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

	<eval name="wt_tm">320</eval>
<repeat><times>6</times>

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

	<cRef label="mahoujin_create_xx2_01"/>

	<w>$wt_tm</w>
	<add name="wt_tm">-25</add>

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

</repeat>

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

	<cRef label="mahoujin_create_xx2_01"/>

	<w>$wt_tm</w>

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

</repeat>
<global name="end_flag">1</global>
</action>

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

<action  label="stage_middle_boss_03_action">
<!-- センターポイントへ移動 -->
	<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>

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

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

	<cRef label="mahoujin_create_xx3_01"><p>160</p><p>1</p></cRef>
	<w>2</w>
	<cRef label="mahoujin_create_xx3_01"><p>480</p><p>-1</p></cRef>

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

	<chD><dir type="abs">80-160*(($_player_cx+$_player_cy)%2)</dir><tm>1</tm></chD>
	<chS><sp>1</sp><tm>10</tm></chS>
	<w>20</w>
	<chS><sp>0</sp><tm>10</tm></chS>
	<w>70</w>
	<repeat><times>$__temp_grank-lt3</times>
		<w>3</w>
	</repeat>
	<repeat><times>1-($__temp_grank-lt3)</times>
		<aRef l="middle_boss_03_act4"><p>0</p></aRef>
	</repeat>
	<w>27</w>
	<repeat><times>$__temp_grank-lt2</times>
		<w>1</w>
	</repeat>
	<repeat><times>1-($__temp_grank-lt2)</times>
		<aRef l="middle_boss_03_act3"><p>20</p></aRef>
	</repeat>
	<w>29</w>
	<repeat><times>$__temp_grank-lt1</times>
		<aRef l="middle_boss_03_act2"/>
	</repeat>
	<repeat><times>1-($__temp_grank-lt1)</times>
		<aRef l="middle_boss_03_act3"><p>0</p></aRef>
	</repeat>
	<w>90</w>
	<repeat><times>$__temp_grank-lt3</times>
		<w>3</w>
	</repeat>
	<repeat><times>1-($__temp_grank-lt3)</times>
		<aRef l="middle_boss_03_act4"><p>0</p></aRef>
	</repeat>
	<w>27</w>
	<repeat><times>$__temp_grank-lt2</times>
		<w>1</w>
	</repeat>
	<repeat><times>1-($__temp_grank-lt2)</times>
		<aRef l="middle_boss_03_act3"><p>20</p></aRef>
	</repeat>
	<w>29</w>
	<repeat><times>$__temp_grank-lt1</times>
		<aRef l="middle_boss_03_act2"/>
	</repeat>
	<repeat><times>1-($__temp_grank-lt1)</times>
		<aRef l="middle_boss_03_act3"><p>0</p></aRef>
	</repeat>

	<!-- 難易度調整用 -->
	<global name="temp_grank">$__grank</global>
	<chD><dir type="rel">180</dir><tm>1</tm></chD>
	<chS><sp>1</sp><tm>10</tm></chS>
	<w>20</w>
	<chS><sp>0</sp><tm>10</tm></chS>
	<w>70</w>
	<repeat><times>$__temp_grank-lt3</times>
		<w>3</w>
	</repeat>
	<repeat><times>1-($__temp_grank-lt3)</times>
		<aRef l="middle_boss_03_act4"><p>-12</p></aRef>
	</repeat>
	<w>27</w>
	<repeat><times>$__temp_grank-lt2</times>
		<w>1</w>
	</repeat>
	<repeat><times>1-($__temp_grank-lt2)</times>
		<aRef l="middle_boss_03_act3"><p>20</p></aRef>
	</repeat>
	<w>29</w>
	<repeat><times>$__temp_grank-lt1</times>
		<aRef l="middle_boss_03_act2"/>
	</repeat>
	<repeat><times>1-($__temp_grank-lt1)</times>
		<aRef l="middle_boss_03_act3"><p>0</p></aRef>
	</repeat>
	<w>90</w>
	<repeat><times>$__temp_grank-lt3</times>
		<w>3</w>
	</repeat>
	<repeat><times>1-($__temp_grank-lt3)</times>
		<aRef l="middle_boss_03_act4"><p>-30</p></aRef>
	</repeat>
	<w>27</w>
	<repeat><times>$__temp_grank-lt2</times>
		<w>1</w>
	</repeat>
	<repeat><times>1-($__temp_grank-lt2)</times>
		<aRef l="middle_boss_03_act3"><p>20</p></aRef>
	</repeat>
	<w>29</w>
	<repeat><times>$__temp_grank-lt1</times>
		<aRef l="middle_boss_03_act2"/>
	</repeat>
	<repeat><times>1-($__temp_grank-lt1)</times>
		<aRef l="middle_boss_03_act3"><p>0</p></aRef>
	</repeat>

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

</repeat>
<global name="end_flag">1</global>

</action>

<a l="middle_boss_03_act2">
	<eval name="sp">0.8+($__temp_grank*0.1)</eval>
	<aRef l="enemy_bullet_action"><p>64</p></aRef>
	<w>1</w>
	<fRef l="enemy_fire_xx3_01"><p>0</p><p>$sp</p></fRef>
	<repeat><times>5</times>
		<fRef l="enemy_fire_xx3_01s"><p>60</p><p>$sp</p></fRef>
	</repeat>
</a>

<a l="middle_boss_03_act3">
	<eval name="sp">1.0+($__temp_grank*0.1)+($__temp_grank-gt3)*0.2</eval>
	<aRef l="enemy_bullet_action"><p>64</p></aRef>
	<fRef l="enemy_fire_xx3_01"><p>$1</p><p>$sp</p></fRef>
	<w>1</w>
	<repeat><times>8</times>
		<fRef l="enemy_fire_xx3_01s"><p>40</p><p>$sp</p></fRef>
	</repeat>
</a>

<a l="middle_boss_03_act4">
	<eval name="sp">1.4+($__temp_grank*0.1)</eval>
	<aRef l="enemy_bullet_action"><p>64</p></aRef>
	<w>1</w>
	<fRef l="enemy_fire_xx3_01"><p>$1</p><p>$sp</p></fRef>
	<repeat><times>9</times>
		<fRef l="enemy_fire_xx3_01s"><p>36</p><p>$sp</p></fRef>
	</repeat>
	<w>1</w>
	<fRef l="enemy_fire_xx3_01s"><p>48</p><p>$sp</p></fRef>
	<repeat><times>9</times>
		<fRef l="enemy_fire_xx3_01s"><p>36</p><p>$sp</p></fRef>
	</repeat>
	<w>1</w>
	<fRef l="enemy_fire_xx3_01s"><p>48</p><p>$sp</p></fRef>
	<repeat><times>9</times>
		<fRef l="enemy_fire_xx3_01s"><p>36</p><p>$sp</p></fRef>
	</repeat>
</a>

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

<action  label="stage_middle_boss_04_action">
<!-- ENEMY 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><p>50</p><p>95</p><p>95</p><p>95</p></actionRef>
<createRef label="stage1_boss_et_shizuku"/>
<!-- センターポイントへ移動 -->
	<changeSpeed>
		<speed type="absolute">2</speed><term>25</term>
	</changeSpeed>

	<changePosition type="center">
		<x>320</x><y>180</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="white_boss_ring"><p>$1</p></createRef>

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

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

	<!-- 難易度調整用 -->
	<global name="temp_grank">$__grank</global>
	<repeat><times>4</times>
		<eval name="sp0">0</eval>
		<repeat><times>$__temp_grank-eq0</times>
			<aRef l="middle_boss_04_act0"><p>0</p><p>$sp0</p></aRef>
			<w>55</w>
		</repeat>
		<repeat><times>$__temp_grank-eq1</times>
			<aRef l="middle_boss_04_act1"><p>0</p><p>$sp0</p></aRef>
			<w>50</w>
		</repeat>
		<repeat><times>$__temp_grank-eq2</times>
			<aRef l="middle_boss_04_act2"><p>0</p><p>$sp0</p></aRef>
			<w>50</w>
		</repeat>
		<repeat><times>$__temp_grank-eq3</times>
			<aRef l="middle_boss_04_act3"><p>0</p><p>$sp0</p></aRef>
			<w>45</w>
		</repeat>
		<repeat><times>$__temp_grank-eq4</times>
			<aRef l="middle_boss_04_act4"><p>0</p><p>$sp0</p></aRef>
			<w>40</w>
		</repeat>
		<repeat><times>$__temp_grank-eq5</times>
			<aRef l="middle_boss_04_act5"><p>0</p><p>$sp0</p></aRef>
			<w>35</w>
		</repeat>
	</repeat>

	<!-- 難易度調整用 -->
	<global name="temp_grank">$__grank</global>
	<repeat><times>5</times>
		<add name="sp0">0.1</add>
		<repeat><times>$__temp_grank-eq0</times>
			<aRef l="middle_boss_04_act0"><p>0</p><p>$sp0</p></aRef>
			<w>55</w>
		</repeat>
		<repeat><times>$__temp_grank-eq1</times>
			<aRef l="middle_boss_04_act1"><p>0</p><p>$sp0</p></aRef>
			<w>50</w>
		</repeat>
		<repeat><times>$__temp_grank-eq2</times>
			<aRef l="middle_boss_04_act2"><p>0</p><p>$sp0</p></aRef>
			<w>50</w>
		</repeat>
		<repeat><times>$__temp_grank-eq3</times>
			<aRef l="middle_boss_04_act3"><p>0</p><p>$sp0</p></aRef>
			<w>45</w>
		</repeat>
		<repeat><times>$__temp_grank-eq4</times>
			<aRef l="middle_boss_04_act4"><p>0</p><p>$sp0</p></aRef>
			<w>40</w>
		</repeat>
		<repeat><times>$__temp_grank-eq5</times>
			<aRef l="middle_boss_04_act5"><p>0</p><p>$sp0</p></aRef>
			<w>35</w>
		</repeat>
	</repeat>

	<!-- 難易度調整用 -->
	<global name="temp_grank">$__grank</global>
	<repeat><times>5</times>
		<add name="sp0">0.1</add>
		<repeat><times>$__temp_grank-eq0</times>
			<aRef l="middle_boss_04_act0"><p>0</p><p>$sp0</p></aRef>
			<w>55</w>
		</repeat>
		<repeat><times>$__temp_grank-eq1</times>
			<aRef l="middle_boss_04_act1"><p>0</p><p>$sp0</p></aRef>
			<w>50</w>
		</repeat>
		<repeat><times>$__temp_grank-eq2</times>
			<aRef l="middle_boss_04_act2"><p>0</p><p>$sp0</p></aRef>
			<w>50</w>
		</repeat>
		<repeat><times>$__temp_grank-eq3</times>
			<aRef l="middle_boss_04_act3"><p>0</p><p>$sp0</p></aRef>
			<w>45</w>
		</repeat>
		<repeat><times>$__temp_grank-eq4</times>
			<aRef l="middle_boss_04_act4"><p>0</p><p>$sp0</p></aRef>
			<w>40</w>
		</repeat>
		<repeat><times>$__temp_grank-eq5</times>
			<aRef l="middle_boss_04_act5"><p>0</p><p>$sp0</p></aRef>
			<w>35</w>
		</repeat>
	</repeat>

	<!-- 難易度調整用 -->
	<global name="temp_grank">$__grank</global>
	<repeat><times>2</times>
		<repeat><times>$__temp_grank-eq0</times>
			<aRef l="middle_boss_04_act0"><p>0</p><p>$sp0</p></aRef>
			<w>55</w>
		</repeat>
		<repeat><times>$__temp_grank-eq1</times>
			<aRef l="middle_boss_04_act1"><p>0</p><p>$sp0</p></aRef>
			<w>50</w>
		</repeat>
		<repeat><times>$__temp_grank-eq2</times>
			<aRef l="middle_boss_04_act2"><p>0</p><p>$sp0</p></aRef>
			<w>50</w>
		</repeat>
		<repeat><times>$__temp_grank-eq3</times>
			<aRef l="middle_boss_04_act3"><p>0</p><p>$sp0</p></aRef>
			<w>45</w>
		</repeat>
		<repeat><times>$__temp_grank-eq4</times>
			<aRef l="middle_boss_04_act4"><p>0</p><p>$sp0</p></aRef>
			<w>40</w>
		</repeat>
		<repeat><times>$__temp_grank-eq5</times>
			<aRef l="middle_boss_04_act5"><p>0</p><p>$sp0</p></aRef>
			<w>35</w>
		</repeat>
	</repeat>


	<!-- 難易度調整用 -->
	<global name="temp_grank">$__grank</global>
	<repeat><times>4</times>
		<eval name="sp0">0</eval>
		<repeat><times>$__temp_grank-eq0</times>
			<aRef l="middle_boss_04_act0"><p>$sp0</p><p>0</p></aRef>
			<w>55</w>
		</repeat>
		<repeat><times>$__temp_grank-eq1</times>
			<aRef l="middle_boss_04_act1"><p>$sp0</p><p>0</p></aRef>
			<w>50</w>
		</repeat>
		<repeat><times>$__temp_grank-eq2</times>
			<aRef l="middle_boss_04_act2"><p>$sp0</p><p>0</p></aRef>
			<w>50</w>
		</repeat>
		<repeat><times>$__temp_grank-eq3</times>
			<aRef l="middle_boss_04_act3"><p>$sp0</p><p>0</p></aRef>
			<w>45</w>
		</repeat>
		<repeat><times>$__temp_grank-eq4</times>
			<aRef l="middle_boss_04_act4"><p>$sp0</p><p>0</p></aRef>
			<w>40</w>
		</repeat>
		<repeat><times>$__temp_grank-eq5</times>
			<aRef l="middle_boss_04_act5"><p>$sp0</p><p>0</p></aRef>
			<w>35</w>
		</repeat>
	</repeat>

	<!-- 難易度調整用 -->
	<global name="temp_grank">$__grank</global>
	<repeat><times>5</times>
		<add name="sp0">0.15</add>
		<repeat><times>$__temp_grank-eq0</times>
			<aRef l="middle_boss_04_act0"><p>$sp0</p><p>0</p></aRef>
			<w>55</w>
		</repeat>
		<repeat><times>$__temp_grank-eq1</times>
			<aRef l="middle_boss_04_act1"><p>$sp0</p><p>0</p></aRef>
			<w>50</w>
		</repeat>
		<repeat><times>$__temp_grank-eq2</times>
			<aRef l="middle_boss_04_act2"><p>$sp0</p><p>0</p></aRef>
			<w>50</w>
		</repeat>
		<repeat><times>$__temp_grank-eq3</times>
			<aRef l="middle_boss_04_act3"><p>$sp0</p><p>0</p></aRef>
			<w>45</w>
		</repeat>
		<repeat><times>$__temp_grank-eq4</times>
			<aRef l="middle_boss_04_act4"><p>$sp0</p><p>0</p></aRef>
			<w>40</w>
		</repeat>
		<repeat><times>$__temp_grank-eq5</times>
			<aRef l="middle_boss_04_act5"><p>$sp0</p><p>0</p></aRef>
			<w>35</w>
		</repeat>
	</repeat>

	<!-- 難易度調整用 -->
	<global name="temp_grank">$__grank</global>
	<repeat><times>5</times>
		<add name="sp0">0.2</add>
		<repeat><times>$__temp_grank-eq0</times>
			<aRef l="middle_boss_04_act0"><p>$sp0</p><p>0</p></aRef>
			<w>55</w>
		</repeat>
		<repeat><times>$__temp_grank-eq1</times>
			<aRef l="middle_boss_04_act1"><p>$sp0</p><p>0</p></aRef>
			<w>50</w>
		</repeat>
		<repeat><times>$__temp_grank-eq2</times>
			<aRef l="middle_boss_04_act2"><p>$sp0</p><p>0</p></aRef>
			<w>50</w>
		</repeat>
		<repeat><times>$__temp_grank-eq3</times>
			<aRef l="middle_boss_04_act3"><p>$sp0</p><p>0</p></aRef>
			<w>45</w>
		</repeat>
		<repeat><times>$__temp_grank-eq4</times>
			<aRef l="middle_boss_04_act4"><p>$sp0</p><p>0</p></aRef>
			<w>40</w>
		</repeat>
		<repeat><times>$__temp_grank-eq5</times>
			<aRef l="middle_boss_04_act5"><p>$sp0</p><p>0</p></aRef>
			<w>35</w>
		</repeat>
	</repeat>

	<!-- 難易度調整用 -->
	<global name="temp_grank">$__grank</global>
	<repeat><times>2</times>
		<repeat><times>$__temp_grank-eq0</times>
			<aRef l="middle_boss_04_act0"><p>$sp0</p><p>0</p></aRef>
			<w>55</w>
		</repeat>
		<repeat><times>$__temp_grank-eq1</times>
			<aRef l="middle_boss_04_act1"><p>$sp0</p><p>0</p></aRef>
			<w>50</w>
		</repeat>
		<repeat><times>$__temp_grank-eq2</times>
			<aRef l="middle_boss_04_act2"><p>$sp0</p><p>0</p></aRef>
			<w>50</w>
		</repeat>
		<repeat><times>$__temp_grank-eq3</times>
			<aRef l="middle_boss_04_act3"><p>$sp0</p><p>0</p></aRef>
			<w>45</w>
		</repeat>
		<repeat><times>$__temp_grank-eq4</times>
			<aRef l="middle_boss_04_act4"><p>$sp0</p><p>0</p></aRef>
			<w>40</w>
		</repeat>
		<repeat><times>$__temp_grank-eq5</times>
			<aRef l="middle_boss_04_act5"><p>$sp0</p><p>0</p></aRef>
			<w>35</w>
		</repeat>
	</repeat>

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

</repeat>
<global name="end_flag">1</global>

</action>

<a l="middle_boss_04_act0">
	<eval name="dir">($_prate+$_player_cx)%17</eval>
	<eval name="sp">1.0+($__temp_grank*0.1)+$1</eval>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_xx5_01"><p>-91+$dir</p><p>8</p><p>$sp</p><p>1</p></fRef>
	<repeat><times>4</times>
		<fRef l="enemy_fire_xx5_01s"><p>18</p><p>8</p><p>$sp</p><p>1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>5</times>
		<fRef l="enemy_fire_xx5_01s"><p>18</p><p>7</p><p>$sp</p><p>1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>5</times>
		<fRef l="enemy_fire_xx5_01s"><p>18</p><p>6</p><p>$sp</p><p>1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>5</times>
		<fRef l="enemy_fire_xx5_01s"><p>18</p><p>5</p><p>$sp</p><p>1</p></fRef>
	</repeat>
	<w>1</w>
	<eval name="sp">1.0+($__temp_grank*0.1)+$2</eval>
	<repeat><times>5</times>
		<fRef l="enemy_fire_xx5_01s"><p>18</p><p>4</p><p>$sp</p><p>-1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>5</times>
		<fRef l="enemy_fire_xx5_01s"><p>18</p><p>3</p><p>$sp</p><p>-1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>5</times>
		<fRef l="enemy_fire_xx5_01s"><p>18</p><p>2</p><p>$sp</p><p>-1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>5</times>
		<fRef l="enemy_fire_xx5_01s"><p>18</p><p>1</p><p>$sp</p><p>-1</p></fRef>
	</repeat>

</a>

<a l="middle_boss_04_act1">
	<eval name="dir">($_prate+$_player_cx)%17</eval>
	<eval name="sp">1.0+($__temp_grank*0.1)+$1</eval>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_xx5_01"><p>-91+$dir</p><p>8</p><p>$sp</p><p>1</p></fRef>
	<repeat><times>5</times>
		<fRef l="enemy_fire_xx5_01s"><p>15</p><p>8</p><p>$sp</p><p>1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>6</times>
		<fRef l="enemy_fire_xx5_01s"><p>15</p><p>7</p><p>$sp</p><p>1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>6</times>
		<fRef l="enemy_fire_xx5_01s"><p>15</p><p>6</p><p>$sp</p><p>1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>6</times>
		<fRef l="enemy_fire_xx5_01s"><p>15</p><p>5</p><p>$sp</p><p>1</p></fRef>
	</repeat>
	<w>1</w>
	<eval name="sp">1.0+($__temp_grank*0.1)+$2</eval>
	<repeat><times>6</times>
		<fRef l="enemy_fire_xx5_01s"><p>15</p><p>4</p><p>$sp</p><p>-1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>6</times>
		<fRef l="enemy_fire_xx5_01s"><p>15</p><p>3</p><p>$sp</p><p>-1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>6</times>
		<fRef l="enemy_fire_xx5_01s"><p>15</p><p>2</p><p>$sp</p><p>-1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>6</times>
		<fRef l="enemy_fire_xx5_01s"><p>15</p><p>1</p><p>$sp</p><p>-1</p></fRef>
	</repeat>

</a>

<a l="middle_boss_04_act2">
	<eval name="dir">($_prate+$_player_cx)%17</eval>
	<eval name="sp">1.0+($__temp_grank*0.1)+$1</eval>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_xx5_01"><p>-91+$dir</p><p>8</p><p>$sp</p><p>1</p></fRef>
	<repeat><times>6</times>
		<fRef l="enemy_fire_xx5_01s"><p>12</p><p>8</p><p>$sp</p><p>1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>8</times>
		<fRef l="enemy_fire_xx5_01s"><p>12</p><p>7</p><p>$sp</p><p>1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>7</times>
		<fRef l="enemy_fire_xx5_01s"><p>12</p><p>6</p><p>$sp</p><p>1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>8</times>
		<fRef l="enemy_fire_xx5_01s"><p>12</p><p>5</p><p>$sp</p><p>1</p></fRef>
	</repeat>
	<w>1</w>
	<eval name="sp">1.0+($__temp_grank*0.1)+$2</eval>
	<repeat><times>7</times>
		<fRef l="enemy_fire_xx5_01s"><p>12</p><p>4</p><p>$sp</p><p>-1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>8</times>
		<fRef l="enemy_fire_xx5_01s"><p>12</p><p>3</p><p>$sp</p><p>-1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>7</times>
		<fRef l="enemy_fire_xx5_01s"><p>12</p><p>2</p><p>$sp</p><p>-1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>8</times>
		<fRef l="enemy_fire_xx5_01s"><p>12</p><p>1</p><p>$sp</p><p>-1</p></fRef>
	</repeat>

</a>

<a l="middle_boss_04_act3">
	<eval name="dir">($_prate+$_player_cx)%17</eval>
	<eval name="sp">1.0+($__temp_grank*0.1)+$1</eval>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_xx5_01"><p>-91+$dir</p><p>8</p><p>$sp</p><p>1</p></fRef>
	<repeat><times>8</times>
		<fRef l="enemy_fire_xx5_01s"><p>360/33</p><p>8</p><p>$sp</p><p>1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>8</times>
		<fRef l="enemy_fire_xx5_01s"><p>360/33</p><p>7</p><p>$sp</p><p>1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>8</times>
		<fRef l="enemy_fire_xx5_01s"><p>360/33</p><p>6</p><p>$sp</p><p>1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>8</times>
		<fRef l="enemy_fire_xx5_01s"><p>360/33</p><p>5</p><p>$sp</p><p>1</p></fRef>
	</repeat>
	<w>1</w>
	<eval name="sp">1.0+($__temp_grank*0.1)+$2</eval>
	<repeat><times>9</times>
		<fRef l="enemy_fire_xx5_01s"><p>360/33</p><p>4</p><p>$sp</p><p>-1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>8</times>
		<fRef l="enemy_fire_xx5_01s"><p>360/33</p><p>3</p><p>$sp</p><p>-1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>8</times>
		<fRef l="enemy_fire_xx5_01s"><p>360/33</p><p>2</p><p>$sp</p><p>-1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>8</times>
		<fRef l="enemy_fire_xx5_01s"><p>360/33</p><p>1</p><p>$sp</p><p>-1</p></fRef>
	</repeat>

</a>

<!--
<a l="middle_boss_04_act3">
	<eval name="dir">($_prate+$_player_cx)%17</eval>
	<eval name="sp">1.0+($__temp_grank*0.1)+$1</eval>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_xx5_01"><p>-91+$dir</p><p>8</p><p>$sp</p><p>1</p></fRef>
	<repeat><times>8</times>
		<fRef l="enemy_fire_xx5_01s"><p>10</p><p>8</p><p>$sp</p><p>1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>9</times>
		<fRef l="enemy_fire_xx5_01s"><p>10</p><p>7</p><p>$sp</p><p>1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>9</times>
		<fRef l="enemy_fire_xx5_01s"><p>10</p><p>6</p><p>$sp</p><p>1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>9</times>
		<fRef l="enemy_fire_xx5_01s"><p>10</p><p>5</p><p>$sp</p><p>1</p></fRef>
	</repeat>
	<w>1</w>
	<eval name="sp">1.0+($__temp_grank*0.1)+$2</eval>
	<repeat><times>9</times>
		<fRef l="enemy_fire_xx5_01s"><p>10</p><p>4</p><p>$sp</p><p>-1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>9</times>
		<fRef l="enemy_fire_xx5_01s"><p>10</p><p>3</p><p>$sp</p><p>-1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>9</times>
		<fRef l="enemy_fire_xx5_01s"><p>10</p><p>2</p><p>$sp</p><p>-1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>9</times>
		<fRef l="enemy_fire_xx5_01s"><p>10</p><p>1</p><p>$sp</p><p>-1</p></fRef>
	</repeat>

</a>

-->
<a l="middle_boss_04_act4">
	<eval name="dir">($_prate+$_player_cx)%17</eval>
	<eval name="sp">1.0+($__temp_grank*0.1)+$1</eval>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_xx5_01"><p>-91+$dir</p><p>8</p><p>$sp</p><p>1</p></fRef>
	<repeat><times>9</times>
		<fRef l="enemy_fire_xx5_01s"><p>9</p><p>8</p><p>$sp</p><p>1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>10</times>
		<fRef l="enemy_fire_xx5_01s"><p>9</p><p>7</p><p>$sp</p><p>1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>10</times>
		<fRef l="enemy_fire_xx5_01s"><p>9</p><p>6</p><p>$sp</p><p>1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>10</times>
		<fRef l="enemy_fire_xx5_01s"><p>9</p><p>5</p><p>$sp</p><p>1</p></fRef>
	</repeat>
	<w>1</w>
	<eval name="sp">1.0+($__temp_grank*0.1)+$2</eval>
	<repeat><times>10</times>
		<fRef l="enemy_fire_xx5_01s"><p>9</p><p>4</p><p>$sp</p><p>-1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>10</times>
		<fRef l="enemy_fire_xx5_01s"><p>9</p><p>3</p><p>$sp</p><p>-1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>10</times>
		<fRef l="enemy_fire_xx5_01s"><p>9</p><p>2</p><p>$sp</p><p>-1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>10</times>
		<fRef l="enemy_fire_xx5_01s"><p>9</p><p>1</p><p>$sp</p><p>-1</p></fRef>
	</repeat>

</a>


<a l="middle_boss_04_act5">
	<eval name="dir">($_prate+$_player_cx)%17</eval>
	<eval name="sp">1.0+($__temp_grank*0.1)+$1</eval>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_xx5_01"><p>-91+$dir</p><p>8</p><p>$sp</p><p>1</p></fRef>
	<repeat><times>10</times>
		<fRef l="enemy_fire_xx5_01s"><p>8</p><p>8</p><p>$sp</p><p>1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>11</times>
		<fRef l="enemy_fire_xx5_01s"><p>8</p><p>7</p><p>$sp</p><p>1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>11</times>
		<fRef l="enemy_fire_xx5_01s"><p>8</p><p>6</p><p>$sp</p><p>1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>12</times>
		<fRef l="enemy_fire_xx5_01s"><p>8</p><p>5</p><p>$sp</p><p>1</p></fRef>
	</repeat>
	<w>1</w>
	<eval name="sp">1.0+($__temp_grank*0.1)+$2</eval>
	<repeat><times>11</times>
		<fRef l="enemy_fire_xx5_01s"><p>8</p><p>4</p><p>$sp</p><p>-1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>11</times>
		<fRef l="enemy_fire_xx5_01s"><p>8</p><p>3</p><p>$sp</p><p>-1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>11</times>
		<fRef l="enemy_fire_xx5_01s"><p>8</p><p>2</p><p>$sp</p><p>-1</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>12</times>
		<fRef l="enemy_fire_xx5_01s"><p>8</p><p>1</p><p>$sp</p><p>-1</p></fRef>
	</repeat>

</a>



<!-- ********************************************************************* -->
<!-- *** 中ボスのアクション　第５形態　                                *** -->
<!-- ***                                                               *** -->
<!-- 4で記載してあるが5 -->

<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><p>50</p><p>95</p><p>95</p><p>95</p></actionRef>
<createRef label="stage1_boss_et_shizuku"/>

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

	<changePosition type="center">
		<x>320</x><y>190</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="white_boss_ring"><p>$1</p></createRef>

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

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

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


	<createRef label="mahoujin_create_xx4_01"><p>148</p><p>$_self_cy</p></createRef>
	<w>45</w>
	<createRef label="mahoujin_create_xx4_01"><p>492</p><p>$_self_cy</p></createRef>

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

	<w>150</w>
	<chD><dir type="abs">85-170*($_player_cx-lt$_self_cx)</dir><tm>1</tm></chD>
	<chS><sp>1</sp><tm>10</tm></chS>
	<w>20</w>
	<chS><sp>0</sp><tm>10</tm></chS>
	<w>10</w>

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

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

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

	<!-- タイマーチェック -->
	<eval name="time_check2">$_stageplayframe-$time_check1</eval>
	<debugstr><string>midboss1</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">2200*($_difficulty+1)</eval>
	<eval name="crystal">(20+$_difficulty*2)</eval>
	<eval name="red_crystal">60</eval>
	<eval name="multi4">1450</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>

	<!-- 打ち返し -->
	<repeat><times>$__grank-eq5</times>
		<actionRef label="revenge_bullet_boss"/>
	</repeat>

	<wait>1</wait>
	<createRef label="item_create_05"><param>0</param><param>-64</param></createRef>

	<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>

	<eval name="vital">14000+($__grank*800)</eval>


	<!-- *** 次の形態のボスの作成 *** -->
	<!-- 侵食率高め、体力少な目 -->
	<createRef label="enemy_create_middle_boss">
		<p>$_self_cx</p><p>$_self_cy</p><p>$vital</p><p>0</p><p>220000+($__grank*2000)</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">2200*($_difficulty+1)</eval>
	<eval name="crystal">(22+$_difficulty*2)</eval>
	<eval name="red_crystal">60</eval>
	<eval name="multi4">1500+($__grank-gt2)*60+($__grank-gt3)*60</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>
	<repeat><times>$_revenge_state-eq3</times>
		<w>1</w>
	</repeat>
	<!-- 打ち返し -->
	<repeat><times>$__grank-eq5</times>
		<actionRef label="revenge_bullet_boss"/>
	</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>
	<eval name="vital">11000+($__grank*700)</eval>

	<!-- *** 次の形態のボスの作成 *** -->
	<createRef label="enemy_create_middle_boss">
		<p>$_self_cx</p><p>$_self_cy</p><p>$vital</p><p>0</p><p>250000+($__grank*3000)</p><p>$__middle_boss_prate3</p>
	</createRef>

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


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

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

	<!-- ランク変動値、ボーナススピリット、スピリット桁数、クリスタル基本値、赤クリスタル基本値、４倍タイマー -->
	<eval name="rank_inc">2200*($_difficulty+1)</eval>
	<eval name="crystal">(24+$_difficulty*2)</eval>
	<eval name="red_crystal">60</eval>
	<eval name="multi4">1300</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>
	<repeat><times>$_revenge_state-eq3</times>
		<w>1</w>
	</repeat>

	<!-- 打ち返し -->
	<repeat><times>$__grank-eq5</times>
		<actionRef label="revenge_bullet_boss"/>
	</repeat>

	<wait>1</wait>

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

		<!-- *** ノーミスノーボムチェック *** -->
<!--		<repeat><times>(($ttc_end-$__ttc_start)-eq($localcounter-$__counter_tmp))*($__ttc_start-gt((300*$_magic_rate/100)-60))</times>
			<addSpirit><spirit>$spirit_inc</spirit></addSpirit>
			<actionRef label="addsp_letter"><param>$spirit_fig_num</param><param>$spirit_inc</param></actionRef>
		</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>-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"/>

	<!-- *** x6の数 55 より大きいで第５形態へ *** -->

	<!-- *** ボスの第５形態まで侵食率5%以下でSECRET *** -->
	<debugstr><string>boss-Secret Judge</string></debugstr>
	<debugval><num>$_prate</num></debugval>

	<eval name="base">50000</eval>

	<!-- *** 次の形態のボスの作成 EM *** -->
	<repeat><times>($_prate-lt$base)*($_stagemisscount-eq0)</times>
		<!-- *** 形態数5 secret *** -->
		<aRef l="secret_hint"><p>$base</p></aRef>
		<sysvar name="secret">$_secret+1</sysvar>
		<global name="boss_state">$__boss_state+1</global>
		<eval name="vital">27000+($__grank*900)</eval>

		<w>1</w>
		<createRef label="enemy_create_middle_boss">
			<p>$_self_cx</p><p>$_self_cy</p><p>$vital</p><p>0</p><p>480000+($__grank*5000)</p><p>$__middle_boss_prate4</p>
		</createRef>
	</repeat>
	<repeat><times>1-(($_prate-lt$base)*($_stagemisscount-eq0))</times>
		<!-- *** 形態数4 *** -->

		<eval name="vital">27000+($__grank*900)</eval>
		<w>1</w>
		<createRef label="enemy_create_middle_boss">
			<p>$_self_cx</p><p>$_self_cy</p><p>$vital</p><p>0</p><p>350000+($__grank*5000)</p><p>$__middle_boss_prate4</p>
		</createRef>
	</repeat>

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


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

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

	<!-- ランク変動値、ボーナススピリット、スピリット桁数、クリスタル基本値、赤クリスタル基本値、４倍タイマー -->
	<!-- ランク変動値は、４倍、EMB取得で２回入る -->
	<eval name="rank_inc">3000*($_difficulty+1)</eval>
	<eval name="crystal">(26+$_difficulty*2)</eval>
	<eval name="red_crystal">70</eval>
	<eval name="multi4">1940</eval>
	<eval name="distance">$1</eval>

	<!-- Enemy Magic Break -->
	<eval name="emb_prate">-20000-($__grank-gt3)*4000-($__grank-gt4)*4000</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">350000+($__grank-gt3)*20000+($__grank-gt4)*20000</eval>

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

	<!-- 爆発アクション -->
	<actionRef label="boss_revenge_present_4"></actionRef>
	<actionRef l="bg_bossbossend_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>

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

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

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

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

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

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

	<!-- Enemy Magic Break -->
	<eval name="emb_prate">-30000-($__grank-gt3)*5000-($__grank-gt4)*5000</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">420000+($__grank-gt3)*20000+($__grank-gt4)*20000</eval>

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

	<!-- 爆発アクション -->
	<actionRef label="boss_revenge_present_4"></actionRef>
	<actionRef l="bg_bossbossend_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>

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


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

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



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

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

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

<!-- ********************************************************************* -->
<!-- *** ボスリング                                                    *** -->

<create l="white_boss_ring">
	<speed>0</speed><dir type="abs">0</dir>
	<cx>$_self_cx-1</cx><cy>$_self_cy-1</cy>
	<child>1</child>
	<object>
		<repeat><times>$1-eq80</times>
			<imgRef l="white_ring_img_80"></imgRef>
		</repeat>
		<repeat><times>$1-eq90</times>
			<imgRef l="white_ring_img_90"></imgRef>
		</repeat>
		<repeat><times>$1-eq100</times>
			<imgRef l="white_ring_img_100"></imgRef>
		</repeat>
		<repeat><times>$1-eq110</times>
			<imgRef l="white_ring_img_110"></imgRef>
		</repeat>
		<repeat><times>$1-eq120</times>
			<imgRef l="white_ring_img_120"></imgRef>
		</repeat>

		<setDrawLevel><num>21</num></setDrawLevel>
		<w>1</w>
		<a>
			<definedAction type="synctoparentx"></definedAction>
			<definedAction type="synctoparenty"></definedAction>

			<rotateImg>
				<direction>-2</direction><term>-1</term>
			</rotateImg>
		
			<rep><ts>-1</ts>
				<changeColor>
					<alpha>64</alpha><red>255</red><green>255</green><blue>255</blue><term>60</term>	
				</changeColor>
				<w>60</w>
				<changeColor>
					<alpha>164</alpha><red>255</red><green>255</green><blue>255</blue><term>60</term>	
				</changeColor>
				<w>60</w>
			</rep>

		</a>
	</object>
</create>

<img type="add" l="white_ring_img_80">
	<file type="dds">white_ring_80</file>
	<left>0</left><top>0</top><right>256</right><bottom>256</bottom>
	<width>256</width><height>256</height>
	<alpha>0</alpha><red>255</red><green>255</green><blue>255</blue>
</img>
<img type="add" l="white_ring_img_90">
	<file type="dds">white_ring_90</file>
	<left>0</left><top>0</top><right>256</right><bottom>256</bottom>
	<width>256</width><height>256</height>
	<alpha>0</alpha><red>255</red><green>255</green><blue>255</blue>
</img>
<img type="add" l="white_ring_img_100">
	<file type="dds">white_ring_100</file>
	<left>0</left><top>0</top><right>256</right><bottom>256</bottom>
	<width>256</width><height>256</height>
	<alpha>0</alpha><red>255</red><green>255</green><blue>255</blue>
</img>
<img type="add" l="white_ring_img_110">
	<file type="dds">white_ring_110</file>
	<left>0</left><top>0</top><right>256</right><bottom>256</bottom>
	<width>256</width><height>256</height>
	<alpha>0</alpha><red>255</red><green>255</green><blue>255</blue>
</img>
<img type="add" l="white_ring_img_120">
	<file type="dds">white_ring_100</file>
	<left>0</left><top>0</top><right>256</right><bottom>256</bottom>
	<width>256*1.2</width><height>256*1.2</height>
	<alpha>0</alpha><red>255</red><green>255</green><blue>255</blue>
</img>

</exbulletml>
