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

<!-- ********************************************************************* -->
<!-- *** ボス戦                                                        *** -->
<!-- ***                                                               *** -->
<action label="stage_main_boss_action">

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

	<!-- *** 会話終了ロックをかける *** -->
	<setLock><num>11</num></setLock>
	
	<!-- *** 最初のボスオブジェクト作成 *** -->
	<global name="temp_grank">$__grank</global>
	<createRef label="enemy_create_main_boss">
		<p>320</p>
		<p>-12</p>
		<p>13200+($__grank*300)</p>
		<p>0</p>
		<p>120000+($__grank*6000)</p>
		<p>$__main_boss_prate</p>
	</createRef>

	<wait>60</wait>

</action>

<!-- ********************************************************************* -->
<!-- *** ボス戦開始                                                    *** -->
<!-- ***                                                               *** -->
<action label="stage_main_boss_start">

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

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

	<sound type="bgm" label="bgm">
		<track><file type="ogg">09_bossC1_loop</file></track>
		<play><flag>1</flag><loop>44100*2*2*3</loop></play>
	</sound>
	<actionRef label="stageC_2_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_main_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_main_boss"></enemyRef>
</create>

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

	<!-- *** 初期設定では衝突判定無し *** -->
	<collision type="circle"><cx>-1</cx><cy>-1</cy><radius>0</radius></collision>
	<presentRef label="stage_main_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>

	<!-- *** 第 N 形態ごとのアクション *** -->
	<repeat><times>$__boss_state-eq1</times>
		<eval name="cross_over">100</eval>
		<revengeRef label="stage_main_boss_01_revenge"><p>$cross_over</p></revengeRef>
		<actionRef  label="stage_main_boss_01_action"><p>$cross_over</p></actionRef> 
	</repeat>

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

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

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

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

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

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

	<!-- secret -->
	<repeat><times>$__boss_state-eq5</times>
		<eval name="cross_over">100</eval>
		<aRef l="p_avrage_add"/>
		<revengeRef label="stage_main_boss_05_revenge"><p>$cross_over</p></revengeRef>

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

</enemy>


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

<action  label="stage_main_boss_01_action">
	<changeSpeed>
		<speed>4.2</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>

	<!-- *** 一人戦闘の場合のvital変更 *** -->
	<setVital>
	<vital>13200+($__grank*300)-($__twins_set-eq1)*(9400+($__grank*200))+(($__twins_set-eq1)*($_twinstype-eq3)*(300+($__grank*100)))</vital>
	</setVital>

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

	<wait>30</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="ch_vital">76</eval> <!-- 元は 84 -->
	<eval name="ad_vital">90-(($__twins_set-eq1)*($_twinstype-eq3)*45)</eval>
	<eval name="ad_count">0</eval>
	<eval name="item">($_prate%6)</eval>
	<w>1</w>
<repeat><times>4</times>

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

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

	<createRef l="enemy_create_b1_01"><p>90</p><p>($item%4)</p><p>0</p><p>$ch_vital</p></createRef>
	<createRef l="enemy_create_b1_01"><p>-90</p><p>(($item+1)%4)</p><p>0</p><p>$ch_vital</p></createRef>
	<w>50</w>
	<createRef l="enemy_create_b1_01"><p>90</p><p>(($item+2)%4)</p><p>15</p><p>$ch_vital</p></createRef>
	<createRef l="enemy_create_b1_01"><p>-90</p><p>(($item+3)%4)</p><p>15</p><p>$ch_vital</p></createRef>
	<w>50</w>
	<createRef l="enemy_create_b1_01"><p>90</p><p>1</p><p>30</p><p>$ch_vital</p></createRef>
	<createRef l="enemy_create_b1_01"><p>-90</p><p>1</p><p>30</p><p>$ch_vital</p></createRef>

	<chS><sp type="abs">1.0</sp><tm>20</tm></chS>
	<chD><dir type="abs">-75+150*($_player_cx-lt320)</dir></chD>
	<w>30</w>
	<chS><sp type="abs">0</sp><tm>20</tm></chS>

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

	<eval name="sp1">1.8+($__temp_grank*0.2)</eval>

	<eval name="dir1">0</eval>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_b_1_01"><p>$sp1</p><p>$dir1</p></fRef>
	<fRef l="enemy_fire_b_1_01d"><p>90+$dir1</p><p>4+($__temp_grank-gt3)</p><p>-90</p><p>$sp1</p></fRef>
	<fRef l="enemy_fire_b_1_01ds"><p>180</p><p>4+($__temp_grank-gt3)</p><p>90</p><p>$sp1</p></fRef>
	<w>1</w>
	<repeat><times>2</times>
		<evaladd name="dir1">120</evaladd>
		<fRef l="enemy_fire_b_1_01"><p>$sp1</p><p>$dir1</p></fRef>
		<fRef l="enemy_fire_b_1_01d"><p>90+$dir1</p><p>4+($__temp_grank-gt3)</p><p>-90</p><p>$sp1</p></fRef>
		<fRef l="enemy_fire_b_1_01ds"><p>180</p><p>4+($__temp_grank-gt3)</p><p>90</p><p>$sp1</p></fRef>
		<w>1</w>
	</repeat>
	<w>6-($__temp_grank-gt3)</w>

	<repeat><times>2-($__temp_grank-lt2)</times>
		<evaladd name="dir1">20+($_prate+$_player_cx+$_self_cy)%27</evaladd>
		<fRef l="enemy_fire_b_1_01"><p>$sp1</p><p>$dir1</p></fRef>
		<fRef l="enemy_fire_b_1_01d"><p>90+$dir1</p><p>4+($__temp_grank-gt3)</p><p>-90</p><p>$sp1</p></fRef>
		<fRef l="enemy_fire_b_1_01ds"><p>180</p><p>4+($__temp_grank-gt3)</p><p>90</p><p>$sp1</p></fRef>
		<w>1</w>
		<repeat><times>2</times>
			<evaladd name="dir1">120</evaladd>
			<fRef l="enemy_fire_b_1_01"><p>$sp1</p><p>$dir1</p></fRef>
			<fRef l="enemy_fire_b_1_01d"><p>90+$dir1</p><p>4+($__temp_grank-gt3)</p><p>-90</p><p>$sp1</p></fRef>
			<fRef l="enemy_fire_b_1_01ds"><p>180</p><p>4+($__temp_grank-gt3)</p><p>90</p><p>$sp1</p></fRef>
			<w>1</w>
		</repeat>
		<w>6-($__temp_grank-gt3)</w>
	</repeat>
	<repeat><times>($__temp_grank-lt2)</times>
		<w>9</w>
	</repeat>

	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<repeat><times>3-($__temp_grank-lt2)</times>
		<evaladd name="dir1">20+($_prate+$_player_cx+$_self_cy)%27</evaladd>
		<fRef l="enemy_fire_b_1_01"><p>$sp1</p><p>$dir1</p></fRef>
		<fRef l="enemy_fire_b_1_01d"><p>90+$dir1</p><p>4+($__temp_grank-gt3)</p><p>-90</p><p>$sp1</p></fRef>
		<fRef l="enemy_fire_b_1_01ds"><p>180</p><p>4+($__temp_grank-gt3)</p><p>90</p><p>$sp1</p></fRef>
		<w>1</w>
		<repeat><times>2</times>
			<evaladd name="dir1">120</evaladd>
			<fRef l="enemy_fire_b_1_01"><p>$sp1</p><p>$dir1</p></fRef>
			<fRef l="enemy_fire_b_1_01d"><p>90+$dir1</p><p>4+($__temp_grank-gt3)</p><p>-90</p><p>$sp1</p></fRef>
			<fRef l="enemy_fire_b_1_01ds"><p>180</p><p>4+($__temp_grank-gt3)</p><p>90</p><p>$sp1</p></fRef>
			<w>1</w>
		</repeat>
		<w>6-($__temp_grank-gt3)</w>
	</repeat>

	<repeat><times>($__temp_grank-lt2)</times>
		<w>9</w>
	</repeat>

	<repeat><times>3</times>
	<evaladd name="sp1">0.25</evaladd>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<repeat><times>3-($__temp_grank-lt2)</times>
		<evaladd name="dir1">30+($_prate+$_player_cx*2+$_self_cy)%27</evaladd>
		<fRef l="enemy_fire_b_1_01"><p>$sp1</p><p>$dir1</p></fRef>
		<fRef l="enemy_fire_b_1_01d"><p>90+$dir1</p><p>4+($__temp_grank-gt3)</p><p>-90</p><p>$sp1</p></fRef>
		<fRef l="enemy_fire_b_1_01ds"><p>180</p><p>4+($__temp_grank-gt3)</p><p>90</p><p>$sp1</p></fRef>
		<w>1</w>
		<repeat><times>2</times>
			<evaladd name="dir1">120</evaladd>
			<fRef l="enemy_fire_b_1_01"><p>$sp1</p><p>$dir1</p></fRef>
			<fRef l="enemy_fire_b_1_01d"><p>90+$dir1</p><p>4+($__temp_grank-gt3)</p><p>-90</p><p>$sp1</p></fRef>
			<fRef l="enemy_fire_b_1_01ds"><p>180</p><p>4+($__temp_grank-gt3)</p><p>90</p><p>$sp1</p></fRef>
			<w>1</w>
		</repeat>
		<w>6-($__temp_grank-gt3)</w>
	</repeat>
	<repeat><times>($__temp_grank-lt2)</times>
		<w>9</w>
	</repeat>
	</repeat>

	<repeat><times>($__temp_grank-gt3)*3</times>
		<aRef l="enemy_bullet_action8"><p>64</p></aRef>
		<evaladd name="dir1">30+($_prate+$_player_cx*3+$_self_cy)%27</evaladd>
		<fRef l="enemy_fire_b_1_01"><p>$sp1</p><p>$dir1</p></fRef>
		<fRef l="enemy_fire_b_1_01d"><p>90+$dir1</p><p>4+($__temp_grank-gt3)</p><p>-90</p><p>$sp1</p></fRef>
		<fRef l="enemy_fire_b_1_01ds"><p>180</p><p>4+($__temp_grank-gt3)</p><p>90</p><p>$sp1</p></fRef>
		<w>1</w>
		<repeat><times>2</times>
			<evaladd name="dir1">120</evaladd>
			<fRef l="enemy_fire_b_1_01"><p>$sp1</p><p>$dir1</p></fRef>
			<fRef l="enemy_fire_b_1_01d"><p>90+$dir1</p><p>4+($__temp_grank-gt3)</p><p>-90</p><p>$sp1</p></fRef>
			<fRef l="enemy_fire_b_1_01ds"><p>180</p><p>4+($__temp_grank-gt3)</p><p>90</p><p>$sp1</p></fRef>
			<w>1</w>
		</repeat>
		<w>2</w>
	</repeat>


	<chS><sp type="abs">1.0</sp><tm>20</tm></chS>
	<chD><dir type="rel">180</dir></chD>
	<w>30</w>
	<chS><sp type="abs">0</sp><tm>20</tm></chS>

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

	<repeat><times>$__temp_grank-gt1</times>
		<eval name="item">($_prate%3)</eval>
		<createRef l="enemy_create_b1_02"><p>180</p><p>1</p><p>$ch_vital*1.5</p></createRef>
		<createRef l="enemy_create_b1_02"><p>140</p><p>1</p><p>$ch_vital*1.5</p></createRef>
		<createRef l="enemy_create_b1_02"><p>220</p><p>1</p><p>$ch_vital*1.5</p></createRef>
	</repeat>
	<repeat><times>$__temp_grank-lt2</times>
		<eval name="item">($_prate%2)</eval>
		<createRef l="enemy_create_b1_02"><p>140</p><p>1</p><p>$ch_vital*1.5</p></createRef>
		<createRef l="enemy_create_b1_02"><p>220</p><p>1</p><p>$ch_vital*1.5</p></createRef>
	</repeat>
	<w>5</w>
	<repeat><times>$__temp_grank-lt3</times>
		<createRef l="enemy_create_b1_02"><p>0</p><p>0</p><p>$ch_vital*1.5</p></createRef>
	</repeat>
	<repeat><times>$__temp_grank-eq3</times>
		<createRef l="enemy_create_b1_02"><p>40</p><p>(($item)%2)</p><p>$ch_vital*1.5</p></createRef>
		<createRef l="enemy_create_b1_02"><p>-40</p><p>(($item+1)%2)</p><p>$ch_vital*1.5</p></createRef>
	</repeat>
	<repeat><times>$__temp_grank-gt3</times>
		<createRef l="enemy_create_b1_02"><p>0</p><p>1</p><p>$ch_vital*1.5</p></createRef>
		<createRef l="enemy_create_b1_02"><p>40</p><p>0</p><p>$ch_vital*1.5</p></createRef>
		<createRef l="enemy_create_b1_02"><p>-40</p><p>1</p><p>$ch_vital*1.5</p></createRef>
	</repeat>
	<w>10</w>

	<evaladd name="ad_count">1</evaladd>
	<eval name="ch_vital">76+($ad_count*$ad_vital)</eval>

	<eval name="rand_dir">-90+45*($__temp_grank-lt2)+(($_player_cx+$_self_cx)%31)</eval>
	<w>5</w>
	<repeat><times>3</times>
	<aRef l="enemy_bullet_action4"><p>64</p></aRef>
	<repeat><times>2</times>
		<fRef l="enemy_fire_b_1_02"><p>1.9+($__temp_grank*0.25)</p><p>$rand_dir</p></fRef>
		<fRef l="enemy_fire_b_1_02s"><p>1.9+($__temp_grank*0.25)</p><p>45</p></fRef>
		<fRef l="enemy_fire_b_1_02s"><p>1.9+($__temp_grank*0.25)</p><p>45</p></fRef>
		<repeat><times>($__temp_grank-gt1)</times>
			<fRef l="enemy_fire_b_1_02s"><p>1.9+($__temp_grank*0.25)</p><p>45</p></fRef>
			<fRef l="enemy_fire_b_1_02s"><p>1.9+($__temp_grank*0.25)</p><p>45</p></fRef>
		</repeat>
		<w>10</w>
		<eval name="rand_dir">-90+(($_prate+$rand_dir*3)%31)</eval>
		<w>5</w>
	</repeat>
	</repeat>
	<w>25</w>
	<eval name="rand_dir">-90+45*($__temp_grank-lt2)+(($_player_cx+$_self_cx)%31)</eval>
	<w>5</w>
	<repeat><times>3</times>
	<aRef l="enemy_bullet_action4"><p>64</p></aRef>
	<repeat><times>2</times>
		<fRef l="enemy_fire_b_1_02"><p>1.9+($__temp_grank*0.25)</p><p>$rand_dir</p></fRef>
		<fRef l="enemy_fire_b_1_02s"><p>1.9+($__temp_grank*0.25)</p><p>45</p></fRef>
		<fRef l="enemy_fire_b_1_02s"><p>1.9+($__temp_grank*0.25)</p><p>45</p></fRef>
		<repeat><times>($__temp_grank-gt1)</times>
			<fRef l="enemy_fire_b_1_02s"><p>1.9+($__temp_grank*0.25)</p><p>45</p></fRef>
			<fRef l="enemy_fire_b_1_02s"><p>1.9+($__temp_grank*0.25)</p><p>45</p></fRef>
		</repeat>
		<w>10</w>
		<eval name="rand_dir">-90+(($_prate+$rand_dir*3)%31)</eval>
		<w>5</w>
	</repeat>
	</repeat>


	<chS><sp type="abs">1.0</sp><tm>20</tm></chS>
	<chD><dir type="abs">-75+150*($_player_cx-lt320)</dir></chD>
	<w>30</w>
	<chS><sp type="abs">0</sp><tm>20</tm></chS>
	<w>15</w>

	<eval name="sp1">1.8+($__temp_grank*0.2)</eval>
	<!-- 難易度調整用 -->
	<global name="temp_grank">$__grank</global>
	<w>5</w>

	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_b_1_01"><p>$sp1</p><p>0</p></fRef>
	<fRef l="enemy_fire_b_1_01ds"><p>90</p><p>4+($__temp_grank-gt3)</p><p>-90</p><p>$sp1</p></fRef>
	<fRef l="enemy_fire_b_1_01ds"><p>180</p><p>4+($__temp_grank-gt3)</p><p>90</p><p>$sp1</p></fRef>
	<w>1</w>
	<repeat><times>2</times>
		<fRef l="enemy_fire_b_1_01s"><p>$sp1</p><p>210</p></fRef>
		<fRef l="enemy_fire_b_1_01ds"><p>90</p><p>4+($__temp_grank-gt3)</p><p>-90</p><p>$sp1</p></fRef>
		<fRef l="enemy_fire_b_1_01ds"><p>180</p><p>4+($__temp_grank-gt3)</p><p>90</p><p>$sp1</p></fRef>
		<w>1</w>
	</repeat>
	<w>6-($__temp_grank-gt3)</w>
	<repeat><times>2-($__temp_grank-lt2)</times>
		<fRef l="enemy_fire_b_1_01s"><p>$sp1</p><p>210+11+11*($__temp_grank-lt2)</p></fRef>
		<fRef l="enemy_fire_b_1_01ds"><p>90</p><p>4+($__temp_grank-gt3)</p><p>-90</p><p>$sp1</p></fRef>
		<fRef l="enemy_fire_b_1_01ds"><p>180</p><p>4+($__temp_grank-gt3)</p><p>90</p><p>$sp1</p></fRef>
		<w>1</w>
		<repeat><times>2</times>
			<fRef l="enemy_fire_b_1_01s"><p>$sp1</p><p>210</p></fRef>
			<fRef l="enemy_fire_b_1_01ds"><p>90</p><p>4+($__temp_grank-gt3)</p><p>-90</p><p>$sp1</p></fRef>
			<fRef l="enemy_fire_b_1_01ds"><p>180</p><p>4+($__temp_grank-gt3)</p><p>90</p><p>$sp1</p></fRef>
			<w>1</w>
		</repeat>
		<w>6-($__temp_grank-gt3)</w>
	</repeat>

	<repeat><times>($__temp_grank-lt2)</times>
		<w>9</w>
	</repeat>


	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<repeat><times>3-($__temp_grank-lt2)</times>
		<fRef l="enemy_fire_b_1_01s"><p>$sp1</p><p>210+11+11*($__temp_grank-lt2)</p></fRef>
		<fRef l="enemy_fire_b_1_01ds"><p>90</p><p>4+($__temp_grank-gt3)</p><p>-90</p><p>$sp1</p></fRef>
		<fRef l="enemy_fire_b_1_01ds"><p>180</p><p>4+($__temp_grank-gt3)</p><p>90</p><p>$sp1</p></fRef>
		<w>1</w>
		<repeat><times>2</times>
			<fRef l="enemy_fire_b_1_01s"><p>$sp1</p><p>210</p></fRef>
			<fRef l="enemy_fire_b_1_01ds"><p>90</p><p>4+($__temp_grank-gt3)</p><p>-90</p><p>$sp1</p></fRef>
			<fRef l="enemy_fire_b_1_01ds"><p>180</p><p>4+($__temp_grank-gt3)</p><p>90</p><p>$sp1</p></fRef>
			<w>1</w>
		</repeat>
		<w>6-($__temp_grank-gt3)</w>
	</repeat>
	<repeat><times>($__temp_grank-lt2)</times>
		<w>9</w>
	</repeat>

	<repeat><times>2</times>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<repeat><times>3-($__temp_grank-lt2)</times>
		<fRef l="enemy_fire_b_1_01s"><p>$sp1</p><p>210-11-11*($__temp_grank-lt2)</p></fRef>
		<fRef l="enemy_fire_b_1_01ds"><p>90</p><p>4+($__temp_grank-gt3)</p><p>-90</p><p>$sp1</p></fRef>
		<fRef l="enemy_fire_b_1_01ds"><p>180</p><p>4+($__temp_grank-gt3)</p><p>90</p><p>$sp1</p></fRef>
		<w>1</w>
		<repeat><times>2</times>
			<fRef l="enemy_fire_b_1_01s"><p>$sp1</p><p>210</p></fRef>
			<fRef l="enemy_fire_b_1_01ds"><p>90</p><p>4+($__temp_grank-gt3)</p><p>-90</p><p>$sp1</p></fRef>
			<fRef l="enemy_fire_b_1_01ds"><p>180</p><p>4+($__temp_grank-gt3)</p><p>90</p><p>$sp1</p></fRef>
			<w>1</w>
		</repeat>
		<w>6-($__temp_grank-gt3)</w>
	</repeat>
	<repeat><times>($__temp_grank-lt2)</times>
		<w>9</w>
	</repeat>
	</repeat>

	<repeat><times>($__temp_grank-gt3)</times>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<repeat><times>2</times>
		<fRef l="enemy_fire_b_1_01s"><p>$sp1</p><p>210-11-11*($__temp_grank-lt2)</p></fRef>
		<fRef l="enemy_fire_b_1_01ds"><p>90</p><p>4+($__temp_grank-gt3)</p><p>-90</p><p>$sp1</p></fRef>
		<fRef l="enemy_fire_b_1_01ds"><p>180</p><p>4+($__temp_grank-gt3)</p><p>90</p><p>$sp1</p></fRef>
		<w>1</w>
		<repeat><times>2</times>
			<fRef l="enemy_fire_b_1_01s"><p>$sp1</p><p>90+210</p></fRef>
			<fRef l="enemy_fire_b_1_01ds"><p>90</p><p>4+($__temp_grank-gt3)</p><p>-90</p><p>$sp1</p></fRef>
			<fRef l="enemy_fire_b_1_01ds"><p>180</p><p>4+($__temp_grank-gt3)</p><p>90</p><p>$sp1</p></fRef>
			<w>1</w>
		</repeat>
		<w>3</w>
	</repeat>
	</repeat>

	<chS><sp type="abs">1.0</sp><tm>20</tm></chS>
	<chD><dir type="rel">180</dir></chD>
	<w>30</w>
	<chS><sp type="abs">0</sp><tm>20</tm></chS>
	<w>20</w>

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

</action>



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

<action  label="stage_main_boss_02_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="boss_ring"><p>$1</p></createRef>

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


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

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

	<eval name="dir1">140+16</eval>
	<createRef label="enemy_create_b2_01d"><p>$dir1</p></createRef>
	<w>10</w>
	<repeat><times>$__temp_grank-gt1</times>
		<createRef label="enemy_create_b2_01d"><p>320-(($_player_cx+$_player_cy+$_prate)%33)*3</p></createRef>
	</repeat>
	<w>10</w>
	<evaladd name="dir1">48</evaladd>
	<createRef label="enemy_create_b2_01d"><p>$dir1</p></createRef>
	<w>10</w>
	<createRef label="enemy_create_b2_01d"><p>320+(($_player_cx*3+$_player_cy+$_prate)%31)*3</p></createRef>
	<w>10</w>
	<evaladd name="dir1">48</evaladd>
	<repeat><times>$__temp_grank-gt1</times>
		<createRef label="enemy_create_b2_01d"><p>$dir1</p></createRef>
	</repeat>
	<w>10</w>
	<repeat><times>$__temp_grank-gt1</times>
		<createRef label="enemy_create_b2_01d"><p>400+(($_player_cx*2+$_player_cy*3+$_prate)%27)*3</p></createRef>
	</repeat>
	<w>10</w>
	<evaladd name="dir1">48</evaladd>
	<repeat><times>$__temp_grank-gt0</times>
		<createRef label="enemy_create_b2_01d"><p>$dir1</p></createRef>
	</repeat>
	<w>10</w>
	<createRef label="enemy_create_b2_01d"><p>300-(($_player_cx+$_player_cy*7+$_prate)%41)*3</p></createRef>
	<w>10</w>
	<evaladd name="dir1">48</evaladd>
	<createRef label="enemy_create_b2_01d"><p>$dir1</p></createRef>
	<w>1+9*($__temp_grank-lt4)</w>
	<repeat><times>$__temp_grank-gt3</times>
		<aRef label="fire_circle"/>
	</repeat>
	<repeat><times>$__temp_grank-gt1</times>
		<createRef label="enemy_create_b2_01d"><p>300+(($_player_cx*7+$_player_cy*2+$_prate)%31)*3</p></createRef>
	</repeat>
	<w>10</w>
	<evaladd name="dir1">48</evaladd>
	<repeat><times>$__temp_grank-gt0</times>
		<createRef label="enemy_create_b2_01d"><p>$dir1</p></createRef>
	</repeat>
	<w>10</w>
	<createRef label="enemy_create_b2_01d"><p>340-(($_player_cx*5+$_player_cy*3+$_prate)%21)*3</p></createRef>
	<w>10</w>
	<evaladd name="dir1">48</evaladd>
	<createRef label="enemy_create_b2_01d"><p>$dir1</p></createRef>
	<w>10</w>
	<createRef label="enemy_create_b2_01d"><p>390+(($_player_cx*7+$_player_cy*5+$_prate)%31)*3</p></createRef>
	<w>10</w>
	<evaladd name="dir1">48</evaladd>
	<createRef label="enemy_create_b2_01d"><p>$dir1</p></createRef>
	<w>1+9*($__temp_grank-lt5)</w>
	<repeat><times>$__temp_grank-gt4</times>
		<aRef label="fire_circle"/>
	</repeat>
	<repeat><times>$__temp_grank-gt1</times>
		<createRef label="enemy_create_b2_01d"><p>270-(($_player_cx*6+$_player_cy*8+$_prate)%31)*3</p></createRef>
	</repeat>

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

	<aRef label="boss_rand_move_c1_01"/>

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

	<eval name="dir1">500-16</eval>
	<createRef label="enemy_create_b2_01d"><p>$dir1</p></createRef>
	<w>10</w>
	<createRef label="enemy_create_b2_01d"><p>320-(($_player_cx+$_player_cy+$_prate)%33)*3</p></createRef>
	<w>10</w>
	<evaladd name="dir1">-48</evaladd>
	<repeat><times>$__temp_grank-gt0</times>
		<createRef label="enemy_create_b2_01d"><p>$dir1</p></createRef>
	</repeat>
	<w>10</w>
	<createRef label="enemy_create_b2_01d"><p>320+(($_player_cx*3+$_player_cy+$_prate)%31)*3</p></createRef>
	<w>10</w>
	<evaladd name="dir1">-48</evaladd>
	<createRef label="enemy_create_b2_01d"><p>$dir1</p></createRef>
	<w>10</w>
	<repeat><times>$__temp_grank-gt1</times>
		<createRef label="enemy_create_b2_01d"><p>400+(($_player_cx*2+$_player_cy*3+$_prate)%27)*3</p></createRef>
	</repeat>
	<w>10</w>
	<evaladd name="dir1">-48</evaladd>
	<repeat><times>$__temp_grank-gt1</times>
		<createRef label="enemy_create_b2_01d"><p>$dir1</p></createRef>
	</repeat>
	<w>10</w>
	<repeat><times>$__temp_grank-gt1</times>
		<createRef label="enemy_create_b2_01d"><p>300-(($_player_cx+$_player_cy*7+$_prate)%41)*3</p></createRef>
	</repeat>
	<w>10</w>
	<evaladd name="dir1">-48</evaladd>
	<createRef label="enemy_create_b2_01d"><p>$dir1</p></createRef>
	<w>1+9*($__temp_grank-lt4)</w>
	<repeat><times>$__temp_grank-gt3</times>
		<aRef label="fire_circle"/>
	</repeat>
	<createRef label="enemy_create_b2_01d"><p>300+(($_player_cx*7+$_player_cy*2+$_prate)%31)*3</p></createRef>
	<w>10</w>
	<evaladd name="dir1">-48</evaladd>
	<repeat><times>$__temp_grank-gt0</times>
		<createRef label="enemy_create_b2_01d"><p>$dir1</p></createRef>
	</repeat>
	<w>10</w>
	<createRef label="enemy_create_b2_01d"><p>340-(($_player_cx*5+$_player_cy*3+$_prate)%21)*3</p></createRef>
	<w>10</w>
	<evaladd name="dir1">-48</evaladd>
	<createRef label="enemy_create_b2_01d"><p>$dir1</p></createRef>
	<w>10</w>
	<repeat><times>$__temp_grank-gt1</times>
		<createRef label="enemy_create_b2_01d"><p>390+(($_player_cx*7+$_player_cy*5+$_prate)%31)*3</p></createRef>
	</repeat>
	<w>10</w>
	<evaladd name="dir1">-48</evaladd>
	<createRef label="enemy_create_b2_01d"><p>$dir1</p></createRef>
	<w>1+9*($__temp_grank-lt5)</w>
	<repeat><times>$__temp_grank-gt4</times>
		<aRef label="fire_circle"/>
	</repeat>
	<repeat><times>$__temp_grank-gt1</times>
		<createRef label="enemy_create_b2_01d"><p>270-(($_player_cx*6+$_player_cy*8+$_prate)%31)*3</p></createRef>
	</repeat>

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

	<aRef label="boss_rand_move_c1_01"/>

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

<!-- *** Bossランダム移動アクション                                    *** -->
<action label="boss_rand_move_c1_01">

	<!-- 右(0)へ行くか、左(1)へ行くか -->
	<repeat><times>($_self_cx-lt260)+($_self_cx-gt380)</times>
		<eval name="ANGLEX">1-($_self_cx-lt260)</eval>
	</repeat>
	<repeat><times>1-(($_self_cx-lt260)+($_self_cx-gt380))</times>
		<eval name="ANGLEX">($_self_cx+$_player_cx+$_player_cy)%2</eval>
	</repeat>

	<!-- 上(0)へ行くか、下(1)へ行くか -->
	<repeat><times>($_self_cy-lt80)+($_self_cy-gt140)</times>
		<eval name="ANGLEY">1-($_self_cy-gt140)</eval>
	</repeat>
	<repeat><times>1-(($_self_cy-lt80)+($_self_cy-gt140))</times>
		<eval name="ANGLEY">($_self_cy+$_player_cx+$_player_cy)%2</eval>
	</repeat>
	<wait>5</wait>

	<!-- 移動方向決定 -->
	<eval name="dir1">(($_self_cy+$_self_cx+$_player_cx+$_player_cy)%21)*2.5</eval>
	<repeat><times>$ANGLEX</times>
		<eval name="dir2">280-$ANGLEY*70+$dir1</eval>
	</repeat>
	<repeat><times>1-$ANGLEX</times>		
		<eval name="dir2">30+$ANGLEY*70+$dir1</eval>
	</repeat>

	<!-- X移動速度制限ありなし判定(1:制限あり) -->
	<eval name="limit_spx">($_self_cx-lt320)*($ANGLEX)+(1-($_self_cx-lt320))*(1-$ANGLEX)</eval>

	<!-- Y移動速度制限ありなし判定(1:制限あり) -->
	<eval name="limit_spy">1-(($dir2-gt60)*($dir2-lt120)+($dir2-gt240)*($dir2-lt300))</eval>
	<eval name="limit_spy">$limit_spy*(1-(($_self_cy-gt110)*(1-$ANGLEY)+($_self_cy-lt70)*($ANGLEY)))</eval>

	<!--移動量、40〜100-->
	<eval name="MOVEBASE">40+(($_self_cy*11+$_player_cx*7)%16)*4*(($limit_spx+$limit_spy)-lt1)</eval>

	<wait>5</wait>

	<changeDirection>
		<direction type="absolute">$dir2</direction><term>1</term>
	</changeDirection>
	<wait>1</wait>
	<changeSpeed><speed>$MOVEBASE/25</speed><term>10</term>
	</changeSpeed>
	<wait>25</wait>
	<changeSpeed><speed>0</speed><term>10</term>
	</changeSpeed>
	<wait>10+($__temp_grank-lt3)*9</wait>

	<repeat><times>$__temp_grank-gt2</times>
		<aRef label="fire_circle"/>
		<!-- wait 9 -->
	</repeat>

</action>

<a label="fire_circle">
<!-- wait 9 -->
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_b_2_01"><p>0</p><p>1.6+($__temp_grank*0.2)+($__temp_grank-eq5)*0.3</p></fRef>
	<repeat><times>5</times>
		<fRef l="enemy_fire_b_2_01s"><p>60</p><p>1.2+($__temp_grank*0.2)+($__temp_grank-eq5)*0.3</p></fRef>
	</repeat>
	<w>1</w>
	<fRef l="enemy_fire_b_2_01s"><p>54</p><p>1.5+($__temp_grank*0.2)+($__temp_grank-eq5)*0.3</p></fRef>
	<repeat><times>5</times>
		<fRef l="enemy_fire_b_2_01s"><p>60</p><p>1.1+($__temp_grank*0.2)+($__temp_grank-eq5)*0.3</p></fRef>
	</repeat>
	<w>1</w>
	<fRef l="enemy_fire_b_2_01s"><p>54</p><p>1.4+($__temp_grank*0.2)+($__temp_grank-eq5)*0.3</p></fRef>
	<repeat><times>5</times>
		<fRef l="enemy_fire_b_2_01s"><p>60</p><p>1.0+($__temp_grank*0.2)+($__temp_grank-eq5)*0.3</p></fRef>
	</repeat>
	<w>1</w>
	<fRef l="enemy_fire_b_2_01s"><p>54</p><p>1.3+($__temp_grank*0.2)+($__temp_grank-eq5)*0.3</p></fRef>
	<repeat><times>5</times>
		<fRef l="enemy_fire_b_2_01s"><p>60</p><p>0.9+($__temp_grank*0.2)+($__temp_grank-eq5)*0.3</p></fRef>
	</repeat>
	<w>1</w>
	<fRef l="enemy_fire_b_2_01s"><p>54</p><p>1.2+($__temp_grank*0.2)+($__temp_grank-eq5)*0.3</p></fRef>
	<repeat><times>5</times>
		<fRef l="enemy_fire_b_2_01s"><p>60</p><p>0.8+($__temp_grank*0.2)+($__temp_grank-eq5)*0.3</p></fRef>
	</repeat>
	<w>1</w>
	<fRef l="enemy_fire_b_2_01s"><p>54</p><p>1.1+($__temp_grank*0.2)+($__temp_grank-eq5)*0.3</p></fRef>
	<repeat><times>5</times>
		<fRef l="enemy_fire_b_2_01s"><p>60</p><p>0.7+($__temp_grank*0.2)+($__temp_grank-eq5)*0.3</p></fRef>
	</repeat>
	<w>1</w>
	<fRef l="enemy_fire_b_2_01s"><p>54</p><p>1.0+($__temp_grank*0.2)+($__temp_grank-eq5)*0.3</p></fRef>
	<w>1</w>
	<fRef l="enemy_fire_b_2_01s"><p>-6</p><p>0.9+($__temp_grank*0.2)+($__temp_grank-eq5)*0.3</p></fRef>
	<w>1</w>
	<fRef l="enemy_fire_b_2_01s"><p>-6</p><p>0.8+($__temp_grank*0.2)+($__temp_grank-eq5)*0.3</p></fRef>
	<w>1</w>
	<fRef l="enemy_fire_b_2_01s"><p>-6</p><p>0.7+($__temp_grank*0.2)+($__temp_grank-eq5)*0.3</p></fRef>
</a>


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

<action  label="stage_main_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="boss_ring"><p>$1</p></createRef>

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

	<!--体力計算-->
	<eval name="firstV">$_self_vital</eval><!-- 初期体力 -->
	<global name="C1_b03_status">1</global>

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

	<eval name="ch_vital">900</eval>
	<eval name="ad_vital">400-(($__twins_set-eq1)*($_twinstype-eq3)*200)</eval>
	<eval name="ad_count">0</eval>
	<w>1</w>

	<!--ポッドを２つ出す-->
	<eval name="DIRECT">75+($_player_cx*17)%30</eval>

	<createRef label="stageC_bossTmp00_podCreate">
		<param>$DIRECT</param>
		<param>28.5-($__temp_grank*3)</param>
		<param>90</param>
		<param>$ch_vital</param> <!-- vital -->
		<param>0</param>
		<param>4</param>
		<param>1</param>
	</createRef>
	<wait>45</wait>

	<repeat><times>$__temp_grank-gt1</times>
		<createRef label="stageC_bossTmp00_podCreate">
			<param>180+$DIRECT</param>
			<param>-28.5+($__temp_grank*3)</param>
			<param>-90</param>
			<param>$ch_vital</param> <!-- vital -->
			<param>0</param>
			<param>4</param>
			<param>0</param>
		</createRef>
	</repeat>
	<global name="enemy_count">1+($__temp_grank-gt1)</global>
	<eval name="item">0</eval>
	<w>1</w>
	<evaladd name="ad_count">1</evaladd>
	<eval name="ch_vital">$ch_vital+((($ad_count%3)-eq0)*$ad_vital)</eval>


<repeat><times>10</times>
	<!-- 難易度調整用 -->
	<global name="temp_grank">$__grank</global>
	<eval name="enemy_base">1+($__temp_grank-gt1)+($__temp_grank-gt2)+($__temp_grank-gt3)</eval>

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

	<repeat><times>($__enemy_count-lt$enemy_base)</times>
		<eval name="DIRECT">65-130*($_self_cx-gt360)</eval>
		<createRef label="stageC_bossTmp00_podCreate">
		<param>$DIRECT</param>
		<param>35-($__temp_grank*3)</param>
		<param>-180</param>
		<param>$ch_vital</param>
		<param>0</param>
		<param>3.4</param>
		<param>($item%4)</param>
		</createRef>
		<global name="enemy_count">$__enemy_count+1</global>
		<evaladd name="item">1</evaladd>
		<evaladd name="ad_count">1</evaladd>
		<eval name="ch_vital">$ch_vital+((($ad_count%3)-eq0)*$ad_vital)</eval>
	</repeat>
	<wait>22</wait>
	<repeat><times>($__enemy_count-lt$enemy_base)</times>
		<eval name="DIRECT">-85+170*($_self_cx-lt240)</eval>
		<createRef label="stageC_bossTmp00_podCreate">
		<param>$DIRECT</param>
		<param>-35+($__temp_grank*3)</param>
		<param>180</param>
		<param>$ch_vital</param>
		<param>0</param>
		<param>2.4</param>
		<param>($item%4)</param>
		</createRef>
		<global name="enemy_count">$__enemy_count+1</global>
		<evaladd name="item">1</evaladd>
		<evaladd name="ad_count">1</evaladd>
		<eval name="ch_vital">$ch_vital+((($ad_count%3)-eq0)*$ad_vital)</eval>
	</repeat>
	<w>23</w>

	<!-- 移動決定 wait1 左右80ライン -->
	<aRef l="lr_move"/>

	<chS><sp type="abs">1.8</sp><tm>10</tm></chS>
	<!-- <w>45</w>以内に sp0にすること -->

	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fireRef label="stageC_bossTmp00_fire03A">
		<param>-90</param>
	</fireRef>
	<repeat><times>2</times>
		<fireRef label="stageC_bossTmp00_fire03B">
			<param>120</param>
		</fireRef>
	</repeat>
	<wait>1</wait>
	<eval name="DIRECT">180</eval>
	<fireRef label="stageC_bossTmp00_fire03B">
		<param>$DIRECT+120</param>
	</fireRef>
	<repeat><times>2</times>
		<fireRef label="stageC_bossTmp00_fire03B">
			<param>120</param>
		</fireRef>
	</repeat>
	<wait>4</wait>
	<repeat><times>5</times>
		<eval name="DIRECT">$DIRECT-19</eval>
		<fireRef label="stageC_bossTmp00_fire03B">
			<param>-1*$DIRECT+120</param>
		</fireRef>
		<repeat><times>2</times>
			<fireRef label="stageC_bossTmp00_fire03B">
				<param>120</param>
			</fireRef>
		</repeat>
		<wait>1</wait>
		<eval name="DIRECT">$DIRECT-19</eval>
		<fireRef label="stageC_bossTmp00_fire03B">
			<param>$DIRECT+120</param>
		</fireRef>
		<repeat><times>2</times>
			<fireRef label="stageC_bossTmp00_fire03B">
				<param>120</param>
			</fireRef>
		</repeat>
		<wait>5</wait>
	</repeat>

	<chS><sp type="abs">0</sp><tm>10</tm></chS>

	<eval name="DIRECT">190</eval>
	<eval name="wait_up">0</eval>
	<w>5</w>

	<repeat><times>4*((($__enemy_count-lt$enemy_base)+($__temp_grank-gt3))-gt0)</times>
		<aRef l="enemy_bullet_action8"><p>64</p></aRef>
		<repeat><times>3</times>
		<eval name="DIRECT">$DIRECT-19</eval>
		<fireRef label="stageC_bossTmp00_fire03B">
			<param>-1*$DIRECT+120</param>
		</fireRef>
		<repeat><times>2</times>
			<fireRef label="stageC_bossTmp00_fire03B">
				<param>120</param>
			</fireRef>
		</repeat>
		<wait>2</wait>
		<eval name="DIRECT">$DIRECT-19</eval>
		<fireRef label="stageC_bossTmp00_fire03B">
			<param>$DIRECT+120</param>
		</fireRef>
		<repeat><times>2</times>
			<fireRef label="stageC_bossTmp00_fire03B">
				<param>120</param>
			</fireRef>
		</repeat>
		<wait>8</wait>
		</repeat>
		<eval name="wait_up">120</eval>
	</repeat>


	<wait>205-$wait_up</wait>
	<!-- タイマーチェック -->
<!--
	<eval name="time_check2">$_stageplayframe-$time_check1</eval>
	<debugstr><string>boss3</string></debugstr>
	<debugval><num>$time_check2</num></debugval>
-->
	<debugstr><string>global</string></debugstr>
	<debugval><num>$__enemy_count</num></debugval>
	<debugval><num>$enemy_base</num></debugval>
</repeat>
<global name="C1_b03_status">0</global>
<global name="end_flag">1</global>

</action>


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

<action  label="stage_main_boss_04_action">
<!-- SECRET MAGIC 演出 0:mid enemy magic  1:mid secret magic 2:boss enemy magic 3:boss secret magic-->
<actionRef label="enemy_magic_action"><p>2</p><param>50</param><param>135</param><param>55</param><param>25</param></actionRef>
<createRef label="stage1_boss_et"></createRef>

<!-- センターポイントへ移動 -->
	<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>110</wait>

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

	<eval name="ch_vital">900</eval> <!-- 元は 1050 -->
	<eval name="ad_count">0</eval>

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

	<!-- 弾幕開始 -->
	<actionRef label="start_boss_bullet"/>
	<eval name="item">0</eval>
<repeat><times>6</times>
	<!-- タイマーチェック -->
	<eval name="time_check1">$_stageplayframe</eval>

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

	<createRef label="mahoujin_create_b3_01"><p>90</p><p>0</p><p>30</p><p>1</p><p>$item%2</p><p>$ch_vital</p></createRef>
	<createRef label="mahoujin_create_b3_02"><p>-90</p><p>0</p><p>25</p><p>-1</p><p>($item+1)%2</p><p>$ch_vital</p></createRef>
	<w>10</w>
	<createRef label="mahoujin_create_b3_03"><p>135</p><p>0</p><p>20</p><p>1</p><p>($item+1)%2</p><p>$ch_vital</p></createRef>
	<createRef label="mahoujin_create_b3_04"><p>-45</p><p>0</p><p>20</p><p>-1</p><p>$item%2</p><p>$ch_vital</p></createRef>
	<w>10</w>
	<repeat><times>$__temp_grank-gt1</times>
		<createRef label="mahoujin_create_b3_05"><p>0</p><p>0</p><p>10</p><p>1</p><p>0</p><p>$ch_vital</p></createRef>
	</repeat>
	<evaladd name="item">1</evaladd>

	<evaladd name="ad_count">1</evaladd>
	<eval name="ch_vital">900+($ad_count*500)</eval>
	<w>100</w>

	<fRef l="enemy_fire_b_3_02d"><p>0</p><p>180</p></fRef>
	<repeat><times>4</times>
		<w>6</w>
		<fRef l="enemy_fire_b_3_02ds"><p>72</p><p>180</p></fRef>
	</repeat>

	<w>100</w>

	<fRef l="enemy_fire_b_3_02ds"><p>36</p><p>60</p></fRef>
	<repeat><times>4</times>
		<w>6</w>
		<fRef l="enemy_fire_b_3_02ds"><p>72</p><p>60</p></fRef>
	</repeat>

	<chD><dir type="abs">89-198*($_player_cx-gt320)</dir><tm>1</tm></chD>
	<chS><sp type="abs">0.5</sp><tm>15</tm></chS>
	<w>15</w>
	<chS><sp type="abs">0</sp><tm>15</tm></chS>
	<w>15</w>


	<repeat><times>$__temp_grank-gt3</times>
		<fRef l="enemy_fire_b_2_02d"><p>0</p></fRef>
		<repeat><times>7</times>
			<w>6</w>
			<fRef l="enemy_fire_b_2_02ds"><p>45</p></fRef>
		</repeat>
		<w>6</w>
		<repeat><times>$__temp_grank-gt4</times>
			<fRef l="enemy_fire_b_2_02ds"><p>21.5+(($_player_cx+$_prate)%3)</p></fRef>
			<repeat><times>7</times>
				<w>6</w>
				<fRef l="enemy_fire_b_2_02ds"><p>45</p></fRef>
			</repeat>
		</repeat>
		<w>6+42*($__temp_grank-lt5)</w>
		<fRef l="enemy_fire_b_2_02ds"><p>21.5+(($_player_cx+$_prate)%3)</p></fRef>
		<repeat><times>7</times>
			<w>6</w>
			<fRef l="enemy_fire_b_2_02ds"><p>45</p></fRef>
		</repeat>
	</repeat>
	<repeat><times>$__temp_grank-lt4</times>
		<w>48</w>
		<repeat><times>$__temp_grank-gt0</times>
		<fRef l="enemy_fire_b_2_02d"><p>0</p></fRef>
			<repeat><times>7</times>
				<w>6</w>
				<fRef l="enemy_fire_b_2_02ds"><p>45</p></fRef>
			</repeat>
		</repeat>
		<w>48+42*($__temp_grank-eq0)</w>
	</repeat>

	<chD><dir type="rel">180</dir><tm>1</tm></chD>
	<chS><sp type="abs">0.5</sp><tm>15</tm></chS>
	<w>15</w>
	<chS><sp type="abs">0</sp><tm>15</tm></chS>
	<w>85</w>

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

</action>

<!-- ********************************************************************* -->
<!-- *** ボスのアクション　第５形態　                                *** -->
<!-- ***  Enemy Magic                                                  *** -->

<action  label="stage_main_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>3</p><param>50</param><param>135</param><param>55</param><param>25</param></actionRef>
<createRef label="stage1_boss_et"></createRef>

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

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

	<wait>110</wait>

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

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

	<!-- 弾幕開始 -->
	<actionRef label="start_boss_bullet"/>
	<eval name="last_dir">1</eval>
	<eval name="item">0</eval>
	<eval name="ch_vital">900</eval> <!-- 元は 1050 -->
	<eval name="ad_count">0</eval>

	<w>1</w>

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

	<createRef label="mahoujin_create_b5_01"><p>90</p><p>0</p><p>27</p><p>1</p><p>$item%2</p><p>$ch_vital</p></createRef>
	<createRef label="mahoujin_create_b5_02"><p>-90</p><p>0</p><p>22</p><p>-1</p><p>($item+1)%2</p><p>$ch_vital</p></createRef>
	<w>10</w>
	<createRef label="mahoujin_create_b5_03"><p>150</p><p>0</p><p>36</p><p>-1</p><p>($item+1)%2</p><p>$ch_vital</p></createRef>
	<createRef label="mahoujin_create_b5_03"><p>-150</p><p>0</p><p>36</p><p>-1</p><p>$item%2</p><p>$ch_vital</p></createRef>
	<w>10</w>
	<createRef label="mahoujin_create_b5_04"><p>30</p><p>0</p><p>36</p><p>1</p><p>0</p><p>$ch_vital</p></createRef>
	<createRef label="mahoujin_create_b5_04"><p>-30</p><p>0</p><p>36</p><p>1</p><p>0</p><p>$ch_vital</p></createRef>
	<evaladd name="item">1</evaladd>
	<w>10</w>

	<evaladd name="ad_count">1</evaladd>
	<eval name="ch_vital">900+($ad_count*600)</eval>

	<eval name="wait1">305</eval>
	<eval name="wait2">15</eval>
	<eval name="last_dir">$last_dir*(-1)</eval>


	<w>5</w>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_b_5_03"><p>0</p><p>3</p><p>$wait2</p><p>$wait1</p><p>$last_dir</p></fRef>
	<repeat><times>7</times>
		<fRef l="enemy_fire_b_5_03s"><p>15</p><p>3</p><p>$wait2</p><p>$wait1</p><p>$last_dir</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>8</times>
		<fRef l="enemy_fire_b_5_03s"><p>15</p><p>2</p><p>$wait2</p><p>$wait1</p><p>$last_dir</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>8</times>
		<fRef l="enemy_fire_b_5_03s"><p>15</p><p>1</p><p>$wait2</p><p>$wait1</p><p>$last_dir</p></fRef>
	</repeat>
	<evaladd name="wait1">-7</evaladd>
	<eval name="wait2">30</eval>

	<repeat><times>4+$__temp_grank</times>
	<w>5</w>
	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_b_5_03s"><p>30</p><p>3</p><p>$wait2</p><p>$wait1</p><p>$last_dir</p></fRef>
	<repeat><times>3</times>
		<fRef l="enemy_fire_b_5_03s"><p>30</p><p>3</p><p>$wait2</p><p>$wait1</p><p>$last_dir</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>4</times>
		<fRef l="enemy_fire_b_5_03s"><p>30</p><p>2</p><p>$wait2</p><p>$wait1</p><p>$last_dir</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>4</times>
		<fRef l="enemy_fire_b_5_03s"><p>30</p><p>1</p><p>$wait2</p><p>$wait1</p><p>$last_dir</p></fRef>
	</repeat>
	<evaladd name="wait1">-7</evaladd>
	<evaladd name="wait2">-3</evaladd>
	</repeat>


	<w>114-($__temp_grank*7)</w>

	<fRef l="enemy_fire_b_3_02d"><p>0</p><p>180</p></fRef>
	<repeat><times>5</times>
		<w>6</w>
		<fRef l="enemy_fire_b_3_02ds"><p>60</p><p>180</p></fRef>
	</repeat>

	<w>100</w>

	<fRef l="enemy_fire_b_3_02ds"><p>30</p><p>50</p></fRef>
	<repeat><times>5</times>
		<w>6</w>
		<fRef l="enemy_fire_b_3_02ds"><p>60</p><p>50</p></fRef>
	</repeat>

	<chD><dir type="abs">89-198*($_player_cx-gt320)</dir><tm>1</tm></chD>
	<chS><sp type="abs">0.5</sp><tm>15</tm></chS>
	<w>15</w>
	<chS><sp type="abs">0</sp><tm>15</tm></chS>
	<w>15</w>

	<fRef l="enemy_fire_b_3_02ds"><p>15</p><p>85</p></fRef>
	<repeat><times>5</times>
		<w>6</w>
		<fRef l="enemy_fire_b_3_02ds"><p>60</p><p>85</p></fRef>
	</repeat>

	<w>20+($__temp_grank-lt4)*30</w>
	<repeat><times>$__temp_grank-gt3</times>
		<fRef l="enemy_fire_b_3_02ds"><p>20</p><p>35</p></fRef>
		<repeat><times>5</times>
			<w>6</w>
			<fRef l="enemy_fire_b_3_02ds"><p>60</p><p>35</p></fRef>
		</repeat>
	</repeat>

	<fRef l="enemy_fire_b_3_02ds"><p>30-($__temp_grank-gt3)*10</p><p>5</p></fRef>
	<repeat><times>5</times>
		<w>6</w>
		<fRef l="enemy_fire_b_3_02ds"><p>60</p><p>5</p></fRef>
	</repeat>



	<chD><dir type="rel">180</dir><tm>1</tm></chD>
	<chS><sp type="abs">0.5</sp><tm>15</tm></chS>
	<w>15</w>
	<chS><sp type="abs">0</sp><tm>15</tm></chS>
	<w>85</w>
	<!-- タイマーチェック -->
<!--	<eval name="time_check2">$_stageplayframe-$time_check1</eval>
	<debugstr><string>boss5</string></debugstr>
	<debugval><num>$time_check2</num></debugval>
-->

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

</action>

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

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

	<!-- ランク変動値、クリスタル基本値、赤クリスタル基本値、４倍タイマー -->
	<eval name="rank_inc">1200*($_difficulty+1)</eval>
	<eval name="crystal">(14+$_difficulty*2)</eval>
	<eval name="red_crystal">44</eval>
	<eval name="multi4">940</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>

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

		<eval name="counter_e">$__counter_tmp</eval>
		<actionRef label="item_counter_01_boss_stage1">
		<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">14200+($__grank*300)-($__twins_set-eq1)*(8800+($__grank*200))+($__twins_set-eq1)*($_twinstype-eq3)*(300+($__grank*200))</eval>

	<!-- *** 次の形態のボスの作成 *** -->
	<createRef label="enemy_create_main_boss">
		<p>$_self_cx</p><p>$_self_cy</p><p>$vital</p><p>0</p><p>120000+($__grank*6000)</p><p>$__main_boss_prate</p>
	</createRef>

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

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

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

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

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

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

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

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

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

	<!-- 打ち返し -->
	<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_stage1">
		<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">14200+($__grank*300)-($__twins_set-eq1)*(9000+($__grank*200))-($__twins_set-eq1)*($_twinstype-eq3)*(600+($__grank*200))</eval>

	<!-- *** 次の形態のボスの作成 *** -->
	<createRef label="enemy_create_main_boss">
		<p>$_self_cx</p><p>$_self_cy</p><p>$vital</p><p>0</p><p>140000+($__grank*7000)</p><p>$__main_boss_prate2</p>
	</createRef>

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

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

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

	<!-- ランク変動値、ボーナススピリット、スピリット桁数、クリスタル基本値、赤クリスタル基本値、４倍タイマー -->
	<eval name="rank_inc">1200*($_difficulty+1)</eval>
	<eval name="crystal">(16+$_difficulty*2)</eval>
	<eval name="red_crystal">50</eval>
	<eval name="multi4">1100+($__grank-gt3)*80</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>

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

	<!-- *** ボスの第３形態までスコアアイテム数126以上でsecretへ *** -->
<!--	<debugstr><string>boss-Secret Judge</string></debugstr>
	<debugval><num>$__item_count</num></debugval>
-->
	<eval name="base">125+($__temp_grank-gt2)*5</eval>

	<!-- *** 次の形態のボスの作成 EM *** -->
	<repeat><times>($__item_count-gt$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">17200+($__grank*300)-($__twins_set-eq1)*(10200+($__grank*200))-($__twins_set-eq1)*($_twinstype-eq3)*(2600+($__grank*200))</eval>
		<createRef label="enemy_create_main_boss">
			<p>$_self_cx</p><p>$_self_cy</p><p>$vital</p><p>0</p><p>300000+($__grank*20000)</p><p>$__main_boss_prate3</p>
		</createRef>
	</repeat>
	<repeat><times>1-(($__item_count-gt$base)*($_stagemisscount-eq0))</times>
		<!-- *** 形態数4 *** -->

		<eval name="vital">17200+($__grank*300)-($__twins_set-eq1)*(10200+($__grank*200))-($__twins_set-eq1)*($_twinstype-eq3)*(2600+($__grank*200))</eval>
		<createRef label="enemy_create_main_boss">
			<p>$_self_cx</p><p>$_self_cy</p><p>$vital</p><p>0</p><p>180000+($__grank*10000)</p><p>$__main_boss_prate3</p>
		</createRef>
	</repeat>

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


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

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

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

	<!-- Enemy Magic Break -->
	<eval name="emb_prate">-12000-($__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">100000+($__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_main_boss_final_revenge_action"/>

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

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

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

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

	<!-- Enemy Magic Break -->
	<eval name="emb_prate">-13000-($__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">120000+($__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_main_boss_final_revenge_action"/>

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



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

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

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