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

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

<action label="stage_middle_boss_action">

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

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

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

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

</action>

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

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

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

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

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

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

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

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

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

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

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

</enemy>


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

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


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

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

	<repeat><times>10</times>
	<wait>3</wait>
	<fireRef l="enemy_fire_01test"/>
	</repeat>
	<w>120</w>
	<changeBulletToItem/>

	<repeat><times>10</times>
	<wait>3</wait>
	<fireRef l="enemy_fire_01test"/>
	</repeat>
	<w>120</w>
	<changeBulletToItem/>

	<repeat><times>10</times>
	<wait>3</wait>
	<fireRef l="enemy_fire_01test"/>
	</repeat>

</action>

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


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

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


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

	<eval name="wait_time">80</eval>
	<!-- 検算：360/$dir_temp*4*$wait_temp < 80　であること -->

	<eval name="wait_temp">2+($__temp_grank-lt2)-($__temp_grank-gt2)</eval>
	<eval name="dir_temp">40+32*($__temp_grank-lt2)-20*($__temp_grank-gt2)</eval>
	<eval name="repeat_temp">(360/$dir_temp)-1</eval>


	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_mb_01"><p>180</p><p>1.5</p><p>$wait_time</p><p>1.0</p></fRef>
	<repeat><times>$repeat_temp</times>
		<evaladd name="wait_time">-1*$wait_temp</evaladd>
		<w>$wait_temp</w>
		<fRef l="enemy_fire_mb_01s"><p>$dir_temp</p><p>2.2</p><p>$wait_time</p><p>1.0</p></fRef>
	</repeat>

	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<evaladd name="wait_time">-1*$wait_temp</evaladd>
	<w>$wait_temp</w>
	<fRef l="enemy_fire_mb_01s"><p>$dir_temp*1.5</p><p>2.2</p><p>$wait_time</p><p>1.0</p></fRef>
	<repeat><times>$repeat_temp</times>
		<evaladd name="wait_time">-1*$wait_temp</evaladd>
		<w>$wait_temp</w>
		<fRef l="enemy_fire_mb_01s"><p>$dir_temp</p><p>2.2</p><p>$wait_time</p><p>1.0</p></fRef>
	</repeat>

	<repeat><times>2</times>
		<aRef l="enemy_bullet_action8"><p>64</p></aRef>
		<evaladd name="wait_time">-1*$wait_temp</evaladd>
		<w>$wait_temp</w>
		<fRef l="enemy_fire_mb_01s"><p>$dir_temp*1.5</p><p>2.2</p><p>$wait_time</p><p>1.0</p></fRef>
		<repeat><times>$repeat_temp</times>
			<evaladd name="wait_time">-1*$wait_temp</evaladd>
			<w>$wait_temp</w>
			<fRef l="enemy_fire_mb_01s"><p>$dir_temp</p><p>2.2</p><p>$wait_time</p><p>1.0</p></fRef>
		</repeat>
	</repeat>


	<wait>120</wait>

	<eval name="mv_dir">($_player_cx-lt320)</eval>
	<chD>
		<dir type="absolute">-60+120*$mv_dir</dir><tm>1</tm>
	</chD>
	<chS><sp>2</sp><tm>10</tm></chS>
	<wait>40</wait>
	<chS><sp>0</sp><tm>10</tm></chS>
	<wait>80</wait>

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

	<eval name="space">15+($__temp_grank-lt2)*3-($__temp_grank-gt2)*3</eval>
	<eval name="space2">12+($__temp_grank-gt2)*2</eval>

	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_mb_02ab"><p>90+($_player_cx+$_player_cy)%5</p><p>1.0</p></fRef>
	<repeat><times>20-$space</times>
		<fRef l="enemy_fire_mb_02s"><p>1</p><p>1.0</p></fRef>
	</repeat>
	<wait>1</wait>
	<repeat><times>9</times>
		<fRef l="enemy_fire_mb_02s"><p>$space</p><p>1.0</p></fRef>
		<repeat><times>20-$space</times>
			<fRef l="enemy_fire_mb_02s"><p>1</p><p>1.0</p></fRef>
		</repeat>
		<wait>1</wait>
	</repeat>

	<eval name="bul2_sp">0.9</eval>
	<eval name="bul2_sp_off">0.1</eval>

	<wait>15</wait>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_mb_02s"><p>-80-$space2+$mv_dir*40</p><p>$bul2_sp</p></fRef>
		<repeat><times>4-($__temp_grank-lt2)</times>
			<fRef l="enemy_fire_mb_02s"><p>-20</p><p>$bul2_sp</p></fRef>
		</repeat>
	<wait>1</wait>

	<repeat><times>5</times>
		<evaladd name="bul2_sp">$bul2_sp_off</evaladd>
		<fRef l="enemy_fire_mb_02s"><p>80</p><p>$bul2_sp</p></fRef>
		<repeat><times>4-($__temp_grank-lt2)</times>
			<fRef l="enemy_fire_mb_02s"><p>-20</p><p>$bul2_sp</p></fRef>
		</repeat>
		<wait>1</wait>
	</repeat>
	
	<chD>
		<dir type="absolute">90-180*$mv_dir</dir><tm>1</tm>
	</chD>

	<chS><sp>3</sp><tm>10</tm></chS>
	<!-- 難易度調整用 -->
	<global name="temp_grank">$__grank</global>

	<repeat><times>($__temp_grank-lt2)</times>
		<wait>45</wait>
	</repeat>
	<repeat><times>($__temp_grank-eq2)</times>
		<wait>35</wait>
		<aRef l="enemy_bullet_action8"><p>64</p></aRef>
		<fRef l="enemy_fire_mb_03"><p>-90</p><p>1.5</p><p>2</p></fRef>
		<repeat><times>7</times>
			<fRef l="enemy_fire_mb_03s"><p>12</p><p>1.5</p><p>2</p></fRef>
		</repeat>
		<wait>1</wait>
		<repeat><times>7</times>
			<fRef l="enemy_fire_mb_03s"><p>12</p><p>1.5</p><p>1</p></fRef>
		</repeat>
		<wait>9</wait>
	</repeat>
	<repeat><times>($__temp_grank-eq3)</times>
		<wait>11</wait>
		<aRef l="enemy_bullet_action8"><p>64</p></aRef>
		<fRef l="enemy_fire_mb_03"><p>-90</p><p>1.9</p><p>2</p></fRef>
		<repeat><times>5</times>
			<fRef l="enemy_fire_mb_03s"><p>15</p><p>1.9</p><p>2</p></fRef>
		</repeat>
		<wait>1</wait>
		<repeat><times>6</times>
			<fRef l="enemy_fire_mb_03s"><p>15</p><p>1.9</p><p>1</p></fRef>
		</repeat>
		<repeat><times>3</times>
			<wait>10</wait>
			<aRef l="enemy_bullet_action8"><p>64</p></aRef>
			<fRef l="enemy_fire_mb_03s"><p>-180</p><p>1.9</p><p>2</p></fRef>
			<repeat><times>5</times>
				<fRef l="enemy_fire_mb_03s"><p>15</p><p>1.9</p><p>2</p></fRef>
			</repeat>
			<wait>1</wait>
			<repeat><times>6</times>
				<fRef l="enemy_fire_mb_03s"><p>15</p><p>1.9</p><p>1</p></fRef>
			</repeat>
<!--
			<wait>8</wait>
			<aRef l="enemy_bullet_action8"><p>64</p></aRef>
			<fRef l="enemy_fire_mb_03s"><p>-180</p><p>1.9</p><p>2</p></fRef>
			<repeat><times>7</times>
				<fRef l="enemy_fire_mb_03s"><p>12</p><p>1.9</p><p>2</p></fRef>
			</repeat>
			<wait>1</wait>
			<repeat><times>7</times>
				<fRef l="enemy_fire_mb_03s"><p>12</p><p>1.9</p><p>1</p></fRef>
			</repeat>
-->
		</repeat>
	</repeat>
	<repeat><times>($__temp_grank-gt3)</times>
		<wait>8</wait>
		<aRef l="enemy_bullet_action8"><p>64</p></aRef>
		<fRef l="enemy_fire_mb_03"><p>-90</p><p>1.9</p><p>2</p></fRef>
		<repeat><times>7</times>
			<fRef l="enemy_fire_mb_03s"><p>12</p><p>1.9</p><p>2</p></fRef>
		</repeat>
		<wait>1</wait>
		<repeat><times>7</times>
			<fRef l="enemy_fire_mb_03s"><p>12</p><p>1.9</p><p>1</p></fRef>
		</repeat>
		<repeat><times>2</times>
			<wait>8</wait>
			<aRef l="enemy_bullet_action8"><p>64</p></aRef>
			<fRef l="enemy_fire_mb_03s"><p>-180</p><p>1.9</p><p>2</p></fRef>
			<repeat><times>7</times>
				<fRef l="enemy_fire_mb_03s"><p>12</p><p>1.9</p><p>2</p></fRef>
			</repeat>
			<wait>1</wait>
			<repeat><times>7</times>
				<fRef l="enemy_fire_mb_03s"><p>12</p><p>1.9</p><p>1</p></fRef>
			</repeat>
			<wait>8</wait>
			<aRef l="enemy_bullet_action8"><p>64</p></aRef>
			<fRef l="enemy_fire_mb_03s"><p>-180</p><p>1.9</p><p>2</p></fRef>
			<repeat><times>7</times>
				<fRef l="enemy_fire_mb_03s"><p>12</p><p>1.9</p><p>2</p></fRef>
			</repeat>
			<wait>1</wait>
			<repeat><times>7</times>
				<fRef l="enemy_fire_mb_03s"><p>12</p><p>1.9</p><p>1</p></fRef>
			</repeat>
		</repeat>
	</repeat>


	<chS><sp>0</sp><tm>20</tm></chS>
	<wait>50</wait>
	
	<!-- 難易度調整用 -->
	<global name="temp_grank">$__grank</global>

	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_mb_02ab"><p>90+($_player_cx+$_player_cy)%5</p><p>1.0</p></fRef>
	<repeat><times>20-$space</times>
		<fRef l="enemy_fire_mb_02s"><p>1</p><p>1.0</p></fRef>
	</repeat>
	<wait>1</wait>
	<repeat><times>9</times>
		<fRef l="enemy_fire_mb_02s"><p>$space</p><p>1.0</p></fRef>
		<repeat><times>20-$space</times>
			<fRef l="enemy_fire_mb_02s"><p>1</p><p>1.0</p></fRef>
		</repeat>
		<wait>1</wait>
	</repeat>

	<eval name="bul2_sp">0.9</eval>
	<eval name="bul2_sp_off">0.1</eval>
	<eval name="mv_dir2">$mv_dir-lt1</eval>

	<wait>15</wait>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_mb_02s"><p>-80-$space2+$mv_dir2*40</p><p>$bul2_sp</p></fRef>
	<repeat><times>4-($__temp_grank-lt2)</times>
		<fRef l="enemy_fire_mb_02s"><p>-20</p><p>$bul2_sp</p></fRef>
	</repeat>
	<wait>1</wait>

	<repeat><times>5</times>
		<evaladd name="bul2_sp">$bul2_sp_off</evaladd>
		<fRef l="enemy_fire_mb_02s"><p>80</p><p>$bul2_sp</p></fRef>
		<repeat><times>4-($__temp_grank-lt2)</times>
			<fRef l="enemy_fire_mb_02s"><p>-20</p><p>$bul2_sp</p></fRef>
		</repeat>
		<wait>1</wait>
	</repeat>

	<wait>60</wait>

	<chD>
		<dir type="absolute">-116+232*$mv_dir</dir><tm>1</tm>
	</chD>
	<chS><sp>2</sp><tm>10</tm></chS>
	<!-- 難易度調整用 -->
	<global name="temp_grank">$__grank</global>

	<eval name="spd">1.0</eval>
	<repeat><times>($__temp_grank-lt2)</times>
		<wait>35</wait>
		<aRef l="enemy_bullet_action8"><p>64</p></aRef>
		<fRef l="enemy_fire_mb_04"><p>-60</p><p>$spd</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>60</p><p>$spd</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>60</p><p>$spd</p></fRef>
		<repeat><times>5</times>
			<wait>2</wait>
			<evaladd name="spd">0.2</evaladd>
			<fRef l="enemy_fire_mb_04s"><p>-119</p><p>$spd</p></fRef>
			<fRef l="enemy_fire_mb_04s"><p>60</p><p>$spd</p></fRef>
			<fRef l="enemy_fire_mb_04s"><p>60</p><p>$spd</p></fRef>
		</repeat>
	</repeat>
	<repeat><times>($__temp_grank-eq2)</times>
		<wait>25</wait>
		<aRef l="enemy_bullet_action8"><p>64</p></aRef>
		<fRef l="enemy_fire_mb_04"><p>-60</p><p>$spd</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>60</p><p>$spd</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>60</p><p>$spd</p></fRef>
		<repeat><times>10</times>
			<wait>2</wait>
			<evaladd name="spd">0.1</evaladd>
			<fRef l="enemy_fire_mb_04s"><p>-117</p><p>$spd</p></fRef>
			<fRef l="enemy_fire_mb_04s"><p>60</p><p>$spd</p></fRef>
			<fRef l="enemy_fire_mb_04s"><p>60</p><p>$spd</p></fRef>
		</repeat>
	</repeat>
	<repeat><times>($__temp_grank-gt2)</times>
		<wait>25</wait>
		<aRef l="enemy_bullet_action8"><p>64</p></aRef>
		<fRef l="enemy_fire_mb_04"><p>-60</p><p>$spd</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>60</p><p>$spd</p></fRef>
		<fRef l="enemy_fire_mb_04s"><p>60</p><p>$spd</p></fRef>
		<repeat><times>20</times>
			<wait>1</wait>
			<evaladd name="spd">0.1</evaladd>
			<fRef l="enemy_fire_mb_04s"><p>-103</p><p>$spd</p></fRef>
			<fRef l="enemy_fire_mb_04s"><p>60</p><p>$spd</p></fRef>
			<fRef l="enemy_fire_mb_04s"><p>60</p><p>$spd</p></fRef>
		</repeat>
	</repeat>
	<chS><sp>0</sp><tm>10</tm></chS>

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

</repeat>

<global name="end_flag">1</global>
<wait>120</wait>

</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>150</y>
	</changePosition>
	<changeSpeed>
		<speed type="absolute">0</speed><term>2</term>
	</changeSpeed>

	<wait>2</wait>

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

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

	<wait>1</wait>
	<eval n="BUL_TOTAL">80</eval>

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

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

	<!--計算式で出てくるパラメータ-->
	<eval n="BUL_ANGLE2">4</eval>

	<rep><ts>($__temp_grank-lt2)</ts>
		<eval n="BUL_SPEED">(1.0+$__temp_grank*0.25)</eval>
		<eval n="BUL_WAIT1">12</eval>
		<eval n="BUL_COUNT">3</eval>
		<eval n="BUL_OFFSET_BASE">3</eval>
	</rep>
	<rep><ts>($__temp_grank-eq2)</ts>
		<eval n="BUL_SPEED">1.6</eval>
		<eval n="BUL_WAIT1">9</eval>
		<eval n="BUL_COUNT">4</eval>
		<eval n="BUL_OFFSET_BASE">4</eval>
	</rep>
	<rep><ts>($__temp_grank-gt2)*($__temp_grank-lt5)</ts>
		<eval n="BUL_SPEED">(1.2+$__temp_grank*0.2)</eval>
		<eval n="BUL_WAIT1">6</eval>
		<eval n="BUL_COUNT">6</eval>
		<eval n="BUL_OFFSET_BASE">4</eval>
	</rep>
	<rep><ts>($__temp_grank-eq5)</ts>
		<eval n="BUL_SPEED">2.3</eval>
		<eval n="BUL_WAIT1">4</eval>
		<eval n="BUL_COUNT">9</eval>
		<eval n="BUL_OFFSET_BASE">4</eval>
	</rep>

	<eval n="BUL_ANGLE">150</eval>

	<repeat><times>6</times>
		<!--時計、上から時計-->
		<eval n="BUL_OFFSET">0</eval>
		<aRef l="enemy_bullet_action8"><p>64</p></aRef>
		<fireRef label="stage1_mboss1_Fire00A">
			<param>$BUL_ANGLE</param>
			<param>0</param>
			<param>$BUL_SPEED</param>
		</fireRef>
		<repeat><times>($BUL_COUNT-1)</times>
			<wait>$BUL_WAIT1</wait>
			<evaladd name="BUL_OFFSET">$BUL_OFFSET_BASE</evaladd>
			<fireRef label="stage1_mboss1_Fire00B">
			<param>$BUL_ANGLE2</param>
			<param>$BUL_OFFSET</param>
			<param>$BUL_SPEED</param>
			</fireRef>
		</repeat>

		<wait>1</wait>
		<repeat><times>($__temp_grank-gt2)</times>
			<evaladd name="BUL_TOTAL">360/($__temp_grank+1)+3</evaladd>
			<fireRef label="stage1_mboss1_Fire00C">
				<param>$BUL_TOTAL</param>
				<param>2+($__temp_grank-eq4)*0.5+($__temp_grank-eq5)</param>
			</fireRef>
			<repeat><times>$__temp_grank</times>
			<evaladd name="BUL_TOTAL">360/($__temp_grank+1)</evaladd>
			<fireRef label="stage1_mboss1_Fire00C">
				<param>$BUL_TOTAL</param>
				<param>2+($__temp_grank-eq4)*0.5+($__temp_grank-eq5)</param>
			</fireRef>
			</repeat>
		</repeat>
		<!--少し待つ-->
		<wait>46-($BUL_COUNT-1)*$BUL_WAIT1</wait>

		<!--反時計、上から反時計-->
		<eval name="BUL_OFFSET">0</eval>
		<aRef l="enemy_bullet_action8"><p>64</p></aRef>
		<fireRef label="stage1_mboss1_Fire00A">
		<param>-1*$BUL_ANGLE</param>
		<param>0</param>
		<param>$BUL_SPEED</param>
		</fireRef>
		<repeat><times>($BUL_COUNT-1)</times>
			<wait>$BUL_WAIT1</wait>
			<evaladd name="BUL_OFFSET">$BUL_OFFSET_BASE</evaladd>
			<fireRef label="stage1_mboss1_Fire00B">
			<param>-1*$BUL_ANGLE2</param>
			<param>-1*$BUL_OFFSET</param>
			<param>$BUL_SPEED</param>
			</fireRef>
		</repeat>
		<wait>1</wait>
		<repeat><times>($__temp_grank-gt2)</times>
			<evaladd name="BUL_TOTAL">360/($__temp_grank+1)+3</evaladd>
			<fireRef label="stage1_mboss1_Fire00C">
				<param>$BUL_TOTAL</param>
				<param>2+($__temp_grank-eq4)*0.5+($__temp_grank-eq5)</param>
			</fireRef>
			<repeat><times>$__temp_grank</times>
			<evaladd name="BUL_TOTAL">360/($__temp_grank+1)</evaladd>
			<fireRef label="stage1_mboss1_Fire00C">
				<param>$BUL_TOTAL</param>
				<param>2+($__temp_grank-eq4)*0.5+($__temp_grank-eq5)</param>
			</fireRef>
			</repeat>
		</repeat>
		<!--少し待つ-->
		<wait>46-($BUL_COUNT-1)*$BUL_WAIT1</wait>
		<eval name="BUL_ANGLE">($BUL_ANGLE+$BUL_ANGLE2*$BUL_COUNT+29)</eval>
	</repeat>
	
	<w>12</w>
	<eval name="time_check2">$_stageplayframe-$time_check1</eval>
<!--
	<debugstr><string>midboss2</string></debugstr>
	<debugval><num>$time_check2</num></debugval>
-->
</repeat>
<global name="end_flag">1</global>
<wait>120</wait>
</action>

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

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

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

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

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

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

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

	
	<eval name="mv_dir">90</eval>
	<eval name="ch_vital">60</eval> <!-- 元は64 -->
	<eval name="ad_vital">48</eval>
	<eval name="ad_count">0</eval>

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

			<createRef l="enemy_create_b01"><p>45</p><p>20</p><p>$ch_vital</p></createRef>
			<wait>1</wait>
			<createRef l="enemy_create_b01s"><p>90</p><p>20</p><p>$ch_vital</p></createRef>
			<wait>1</wait>
			<createRef l="enemy_create_b01s"><p>90</p><p>20</p><p>$ch_vital</p></createRef>
			<wait>1</wait>
			<createRef l="enemy_create_b01s"><p>90</p><p>20</p><p>$ch_vital</p></createRef>

			<evaladd name="ad_count">1</evaladd>
			<eval name="ch_vital">60+(($ad_count/2)%100)*$ad_vital</eval>
			<wait>27</wait>
		<chD>
			<direction type="absolute">$mv_dir</direction><term>1</term>
		</chD>
		<chS>
			<sp type="absolute">2</sp><tm>30</tm>
		</chS>
		<wait>30</wait>
		<chS>
			<sp type="absolute">0</sp><tm>30</tm>
		</chS>
		<eval name="mv_dir">-1*$mv_dir</eval>
		<repeat><times>1-($__temp_grank-gt2)</times>
			<wait>120</wait>
		</repeat>
		<repeat><times>$__temp_grank-gt2</times>
			<wait>5</wait>
			<eval name="wait_temp">60</eval>
			<eval name="bul_num">12-($__temp_grank-lt2)*2+($__temp_grank-eq3)*3+($__temp_grank-eq4)*8+($__temp_grank-eq5)*13</eval>
			<eval name="bul_wait">5+($__temp_grank-lt2)-($__temp_grank-eq3)-($__temp_grank-eq4)*2-($__temp_grank-eq5)*3</eval>

			<aRef l="enemy_bullet_action"><p>32</p></aRef>
			<fRef l="enemy_fire_mbe_01"><p>360/$bul_num</p><p>2.4</p><p>15</p><p>1.5</p></fRef>
			<repeat><times>($bul_num)-1</times>
				<w>$bul_wait</w>
				<fRef l="enemy_fire_mbe_01s"><p>360/$bul_num</p><p>2.4</p><p>15</p><p>1.5</p></fRef>
			</repeat>
			<wait>55+($__temp_grank-eq5)*10</wait>
		</repeat>

	</repeat>

<global name="end_offset">120</global>
<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">800*($_difficulty+1)</eval>
	<eval name="crystal">(10+$_difficulty*2)</eval>
	<eval name="red_crystal">40</eval>
	<eval name="multi4">720</eval>
	<eval name="distance">$1</eval>

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

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

	<!-- *** アイテムの出現 *** -->
<!--
	<createRef label="item_create_03"><param>0</param><param>0</param></createRef>
	<createRef label="item_create_03"><param>32-($_self_cx%9)*8</param><param>32-$_self_cx%64</param></createRef>
	<wait>1</wait>
	<repeat><times>$_revenge_state-eq1</times>
		<createRef label="item_create_03"><param>16-$_self_cy%32</param><param>16-($_self_cy%8)*4</param></createRef>
		<createRef label="item_create_03"><param>12-$_self_cx%24</param><param>24-$_self_cx%48</param></createRef>
		<createRef label="item_create_03"><param>24-($_self_cy%8)*6</param><param>12-$_self_cy%24</param></createRef>
	</repeat>
-->
	<wait>1</wait>

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

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

	<wait>60</wait>

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

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

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

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

	<!-- ランク変動値、クリスタル基本値、赤クリスタル基本値、４倍タイマー -->
	<eval name="rank_inc">800*($_difficulty+1)</eval>
	<eval name="crystal">(12+$_difficulty*2)</eval>
	<eval name="red_crystal">40</eval>
	<eval name="multi4">640</eval>
	<eval name="distance">$1</eval>

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

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

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

	<!-- *** アイテムの出現 *** -->
<!--
	<createRef label="item_create_03"><param>0</param><param>0</param></createRef>
	<createRef label="item_create_03"><param>32-($_self_cx%9)*8</param><param>32-$_self_cx%64</param></createRef>
	<wait>1</wait>
	<repeat><times>$_revenge_state-eq1</times>
		<createRef label="item_create_03"><param>16-$_self_cy%32</param><param>16-($_self_cy%8)*4</param></createRef>
		<createRef label="item_create_03"><param>12-$_self_cx%24</param><param>24-$_self_cx%48</param></createRef>
		<createRef label="item_create_03"><param>24-($_self_cy%8)*6</param><param>12-$_self_cy%24</param></createRef>
	</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>

	<!-- *** crystalの数 900 以上で第３形態へ *** -->
<!--
	<debugstr><string>Mboss-Secret Judge</string></debugstr>
	<debugval><num>$_ecrystal2</num></debugval>
-->
	<eval name="base">900-($__stage_init_rank-lt2)*100+($__stage_init_rank-gt2)*100</eval>

	<repeat><times>($_ecrystal2-gt$base)*($_stagemisscount-eq0)</times>
		<global name="boss_secret">1</global>
		<sysvar name="secret">$_secret+1</sysvar>
		<aRef l="secret_hint"><p>$base</p></aRef>
		<actionRef label="boss_revenge_present_3"/>
		<createRef label="enemy_create_middle_boss">
			<p>$_self_cx</p><p>$_self_cy</p><p>10900+300*$__grank</p><p>0</p><p>100000+2000*$__grank</p><p>$__middle_boss_prate3</p>
		</createRef>
		<vanish/>
	</repeat>

	<repeat><times>1-(($_ecrystal2-gt$base)*($_stagemisscount-eq0))</times>
		<actionRef label="stage_middle_boss_final_revenge_action"></actionRef>
	</repeat>
</revenge>

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

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

	<!-- ランク変動値、クリスタル基本値、赤クリスタル基本値、４倍タイマー -->
	<eval name="rank_inc">1100*($_difficulty+1)</eval>
	<eval name="crystal">(14+$_difficulty*2)</eval>
	<eval name="red_crystal">40</eval>
	<eval name="multi4">1020</eval>
	<eval name="distance">$1</eval>

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

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

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


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


	<!-- *** アイテムの出現 *** -->
<!--
	<createRef label="item_create_03"><param>0</param><param>0</param></createRef>
	<createRef label="item_create_03"><param>32-($_self_cx%9)*8</param><param>32-$_self_cx%64</param></createRef>
	<wait>1</wait>
	<repeat><times>$_revenge_state-eq1</times>
		<createRef label="item_create_03"><param>16-$_self_cy%32</param><param>16-($_self_cy%8)*4</param></createRef>
		<createRef label="item_create_03"><param>12-$_self_cx%24</param><param>24-$_self_cx%48</param></createRef>
		<createRef label="item_create_03"><param>24-($_self_cy%8)*6</param><param>12-$_self_cy%24</param></createRef>
	</repeat>
-->
	<wait>1</wait>

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

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

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


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

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

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

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

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