<?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>14200+($__grank*300)</p>
		<p>0</p>
		<p>140000+($__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">80</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">213</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">90</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">268</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">269</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">110</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">269</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>14000+($__grank*300)-($__twins_set-eq1)*(11000+($__grank*200))-($__twins_set-eq1)*($_twinstype-eq3)*(600+($__grank*200))</vital>
	</setVital>

	<!-- *** 第 1 形態に限りゲージ類をここで作成 *** -->
	<createRef label="boss_vital_create"></createRef>
	<createRef label="boss_underbar_create"></createRef>
	<global name="timer">12</global>
	<global name="timerwait">262</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</eval>
	<eval name="ad_count">0</eval>
	<eval name="item">($_prate%6)</eval>
	<w>1</w>
<repeat><times>3</times>

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

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

	<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">0.8</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>20</w>
	
	<!-- 難易度調整用 -->
	<global name="temp_grank">$__grank</global>

	<aRef l="boss01_circle"/>

	<w>70</w>

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

	<createRef l="enemy_create_b1_02"><p>90</p><p>1</p><p>0</p><p>$ch_vital</p></createRef>
	<w>20</w>
	<createRef l="enemy_create_b1_02"><p>-90</p><p>1</p><p>0</p><p>$ch_vital</p></createRef>
	<w>20</w>
	<createRef l="enemy_create_b1_02"><p>90</p><p>1</p><p>8</p><p>$ch_vital</p></createRef>
	<w>20</w>
	<createRef l="enemy_create_b1_02"><p>-90</p><p>1</p><p>8</p><p>$ch_vital</p></createRef>
	<w>20</w>
	<createRef l="enemy_create_b1_02"><p>90</p><p>1</p><p>17</p><p>$ch_vital</p></createRef>
	<w>20</w>
	<createRef l="enemy_create_b1_02"><p>-90</p><p>1</p><p>17</p><p>$ch_vital</p></createRef>

	<evaladd name="item">1</evaladd>

	<chS><sp type="abs">0.8</sp><tm>20</tm></chS>
	<chD><dir type="abs">-95+190*($_player_cx-gt320)</dir></chD>
	<w>30</w>
	<chS><sp type="abs">0</sp><tm>20</tm></chS>
	<w>20</w>
	<!-- 難易度調整用 -->
	<global name="temp_grank">$__grank</global>

	<aRef l="boss01_circle"/>
	<w>70</w>
	<!-- 難易度調整用 -->
	<global name="temp_grank">$__grank</global>

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

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

	<chS><sp type="abs">0.8</sp><tm>20</tm></chS>
	<chD><dir type="abs">-85+170*($_self_cx-lt320)</dir></chD>
	<w>30</w>
	<chS><sp type="abs">0</sp><tm>20</tm></chS>
	<w>20</w>
	<!-- 難易度調整用 -->
	<global name="temp_grank">$__grank</global>

	<aRef l="boss01_circle"/>
	<w>30</w>
	<chS><sp type="abs">0.8</sp><tm>20</tm></chS>
	<chD><dir type="abs">-85+170*($_self_cx-lt320)</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>
	<debugval><num>$_self_cx</num></debugval>
	<debugval><num>$_self_cy</num></debugval>
-->

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

</action>

<a l="boss01_circle">
	<eval name="sp1">1.8+($__temp_grank*0.2)</eval>
	<eval name="dir1">0</eval>
	<eval name="dir2">50-($__temp_grank*5)</eval>
	<w>10</w>

	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<fRef l="enemy_fire_b_1_02"><p>-90</p><p>$sp1</p><p>$dir1</p><p>3</p></fRef>
	<repeat><times>5-($__temp_grank-lt3)+($__temp_grank-gt3)+($__temp_grank-gt4)</times>
		<fRef l="enemy_fire_b_1_02s"><p>$dir2</p><p>$sp1</p><p>$dir1</p><p>3</p></fRef>
	</repeat>
	<w>1</w>
	<repeat><times>5-($__temp_grank-lt3)+($__temp_grank-gt3)+($__temp_grank-gt4)</times>
		<fRef l="enemy_fire_b_1_02s"><p>$dir2</p><p>$sp1</p><p>$dir1</p><p>2</p></fRef>
	</repeat>
	<repeat><times>4-($__temp_grank-lt1)</times>
		<w>5</w>
		<repeat><times>6-($__temp_grank-lt3)+($__temp_grank-gt3)+($__temp_grank-gt4)</times>
			<fRef l="enemy_fire_b_1_02s"><p>$dir2+13</p><p>$sp1</p><p>$dir1</p><p>3</p></fRef>
		</repeat>
		<w>1</w>
		<repeat><times>5-($__temp_grank-lt3)+($__temp_grank-gt3)+($__temp_grank-gt4)</times>
			<fRef l="enemy_fire_b_1_02s"><p>$dir2</p><p>$sp1</p><p>$dir1</p><p>2</p></fRef>
		</repeat>
	</repeat>
	<w>6+6*($__temp_grank-lt1)</w>

	<repeat><times>2</times>
		<w>5</w>
		<aRef l="enemy_bullet_action8"><p>64</p></aRef>
		<fRef l="enemy_fire_b_1_02s"><p>$dir2+15</p><p>$sp1</p><p>$dir1</p><p>3</p></fRef>
		<repeat><times>6-($__temp_grank-lt3)+($__temp_grank-gt3)+($__temp_grank-gt4)</times>
			<fRef l="enemy_fire_b_1_02s"><p>$dir2</p><p>$sp1</p><p>$dir1</p><p>3</p></fRef>
		</repeat>
		<w>1</w>
		<repeat><times>5-($__temp_grank-lt3)+($__temp_grank-gt3)+($__temp_grank-gt4)</times>
			<fRef l="enemy_fire_b_1_02s"><p>$dir2</p><p>$sp1</p><p>$dir1</p><p>2</p></fRef>
		</repeat>
		<repeat><times>4-($__temp_grank-lt1)</times>
			<w>5</w>
			<repeat><times>6-($__temp_grank-lt3)+($__temp_grank-gt3)+($__temp_grank-gt4)</times>
				<fRef l="enemy_fire_b_1_02s"><p>$dir2+23</p><p>$sp1</p><p>$dir1</p><p>3</p></fRef>
			</repeat>
			<w>1</w>
			<repeat><times>5-($__temp_grank-lt3)+($__temp_grank-gt3)+($__temp_grank-gt4)</times>
				<fRef l="enemy_fire_b_1_02s"><p>$dir2</p><p>$sp1</p><p>$dir1</p><p>2</p></fRef>
			</repeat>
		</repeat>
		<w>6+6*($__temp_grank-lt1)</w>
	</repeat>

</a>


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

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

	<global name="enemy_count">4</global>
	<global name="C1_b02_status">1</global>

	<eval name="item">0</eval>

	<!-- param 3つめは、サブキャラ用 -->
	<createRef label="mahoujin_create_b2_01"><p>80</p><p>25</p><p>0</p><p>$item%2</p></createRef>
	<createRef label="mahoujin_create_b2_01"><p>-80</p><p>25</p><p>0</p><p>1</p></createRef>
	<w>2</w>
	<createRef label="mahoujin_create_b2_01"><p>35</p><p>13</p><p>0</p><p>1</p></createRef>
	<createRef label="mahoujin_create_b2_01"><p>-35</p><p>13</p><p>0</p><p>($item+1)%2</p></createRef>


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

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

	<repeat><times>$__enemy_count-eq0</times>
		<evaladd name="item">1</evaladd>
		<createRef label="mahoujin_create_b2_01"><p>80</p><p>25</p><p>0</p><p>$item%2</p></createRef>
		<createRef label="mahoujin_create_b2_01"><p>-80</p><p>25</p><p>0</p><p>1</p></createRef>
		<w>2</w>
		<createRef label="mahoujin_create_b2_01"><p>35</p><p>13</p><p>0</p><p>1</p></createRef>
		<createRef label="mahoujin_create_b2_01"><p>-35</p><p>13</p><p>0</p><p>($item+1)%2</p></createRef>
		<global name="enemy_count">4</global>
	</repeat>

	<w>30-($__enemy_count-eq0)*2</w>

	<!-- 十字分裂に18フレームかかるので重ねすぎないこと -->
	<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><times>2</times>
	<w>6</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>

	<chD><dir type="absolute">80-160*($_player_cx-lt320)</dir><tm>1</tm></chD>
	<chS><sp type="abs">3</sp><tm>20</tm></chS>
	<w>30</w>
	<chS><sp type="abs">0</sp><tm>20</tm></chS>
	<w>20</w>

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

	<!-- 十字分裂に18フレームかかるので重ねすぎないこと -->
	<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><times>2</times>
	<w>6</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>

	<chD><dir type="relative">180</dir><tm>1</tm></chD>
	<chS><sp type="abs">3</sp><tm>20</tm></chS>
	<w>30</w>
	<chS><sp type="abs">0</sp><tm>20</tm></chS>
	<w>20</w>


	<!-- タイマーチェック -->
<!--	<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="C1_b02_status">0</global>
<global name="end_flag">1</global>
</action>


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

<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="ch_vital">850</eval> <!-- 元は 900 -->
	<eval name="ad_vital">400</eval>
	<eval name="ad_count">0</eval>
	<w>1</w>

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

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


	<eval name="RANDOM">($_self_cx*7+$_player_cx)%30</eval>
	<repeat><times>$_self_cy-lt80</times>
		<eval name="RANDOM">$RANDOM+15</eval>
	</repeat>
	<repeat><times>$_self_cy-gt160</times>
		<eval name="RANDOM">$RANDOM-15</eval>
	</repeat>
	<repeat><times>$_player_cx-gt$_self_cx</times>
	<eval name="RANDOM">$RANDOM/4+180</eval>
	</repeat>
	<!--ポッドを出す(自機X>本体Xなら左誤差7.5度程度)-->
		<createRef label="stageC_bossTmp02_PodCreate">
		<param>$RANDOM+82.5</param><param>1</param><param>$ch_vital</param>
		</createRef>
	<wait>33</wait>
	<repeat><times>$__temp_grank-gt2</times>
		<createRef label="stageC_bossTmp02_PodCreate">
		<param>$RANDOM+262.5</param><param>0</param><param>$ch_vital</param>
		</createRef>
	</repeat>
	<wait>33</wait>
	<repeat><times>$__temp_grank-gt3</times>
		<createRef label="stageC_bossTmp02_PodCreate">
		<param>$RANDOM+78.5</param><param>0</param><param>$ch_vital</param>
		</createRef>
	</repeat>
	<wait>34</wait>
	<!--もいっこポッドを出す、反対方向-->
		<createRef label="stageC_bossTmp02_PodCreate">
		<param>$RANDOM+258.5</param><param>0</param><param>$ch_vital</param>
		</createRef>

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

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

	<actionRef  label="stageC_bossTmp02_subaction02"/>

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

	<wait>60</wait>

	<!-- 難易度調整用 -->
	<global name="temp_grank">$__grank</global>
	<eval name="RANDOM">($_self_cx*7+$_player_cx)%30</eval>
	<repeat><times>$_self_cy-lt80</times>
		<eval name="RANDOM">$RANDOM+15</eval>
	</repeat>
	<repeat><times>$_self_cy-gt160</times>
		<eval name="RANDOM">$RANDOM-15</eval>
	</repeat>
	<repeat><times>$_player_cx-gt$_self_cx</times>
	<eval name="RANDOM">$RANDOM/4+180</eval>
	</repeat>
	<!--ポッドを出す(自機X>本体Xなら左誤差7.5度程度)-->
		<createRef label="stageC_bossTmp02_PodCreate">
		<param>$RANDOM+82.5</param><param>0</param><param>$ch_vital</param>
		</createRef>
	<wait>33</wait>
	<repeat><times>$__temp_grank-gt2</times>
		<createRef label="stageC_bossTmp02_PodCreate">
		<param>$RANDOM+262.5</param><param>0</param><param>$ch_vital</param>
		</createRef>
	</repeat>
	<wait>33</wait>
	<repeat><times>$__temp_grank-gt3</times>
		<createRef label="stageC_bossTmp02_PodCreate">
		<param>$RANDOM+78.5</param><param>1</param><param>$ch_vital</param>
		</createRef>
	</repeat>
	<wait>34</wait>
	<!--もいっこポッドを出す、反対方向-->
		<createRef label="stageC_bossTmp02_PodCreate">
		<param>$RANDOM+258.5</param><param>0</param><param>$ch_vital</param>
		</createRef>
	<wait>100</wait>
	<evaladd name="ad_count">1</evaladd>
	<eval name="ch_vital">850+($ad_count*$ad_vital)</eval>

	<actionRef  label="stageC_bossTmp02_subactionMOVE"/>


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

</action>


<action  label="stageC_bossTmp02_subaction02">
	<wait>30</wait>

	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<eval name="DIRECT">180</eval>
	<fireRef label="stageC_bossTmp02_fire02A">
	<param>-90</param>
	</fireRef>
	<fireRef label="stageC_bossTmp02_fire02B">
	<param>$DIRECT</param>
	</fireRef>
	<repeat><times>3+($__temp_grank)</times>
		<wait>3</wait>
		<eval name="DIRECT">$DIRECT-180/(26+$__temp_grank*3)</eval>
		<fireRef label="stageC_bossTmp02_fire02B">
		<param>-1*$DIRECT</param>
		</fireRef>
		<eval name="DIRECT">$DIRECT-180/(26+$__temp_grank*3)</eval>
		<fireRef label="stageC_bossTmp02_fire02B">
		<param>$DIRECT</param>
		</fireRef>
	</repeat>

	<aRef l="enemy_bullet_action8"><p>64</p></aRef>
	<repeat><times>3+($__temp_grank)</times>
		<wait>3</wait>
		<eval name="DIRECT">$DIRECT-180/(26+$__temp_grank*3)</eval>
		<fireRef label="stageC_bossTmp02_fire02B">
		<param>-1*$DIRECT</param>
		</fireRef>
		<eval name="DIRECT">$DIRECT-180/(26+$__temp_grank*3)</eval>
		<fireRef label="stageC_bossTmp02_fire02B">
		<param>$DIRECT</param>
		</fireRef>
	</repeat>
	<w>3+((5-$__temp_grank)*6)</w>
	<!--移動＋狙い弾-->
		<!--移動方向決定ルーチン-->
		<eval name="RANDOM">75+($_player_cx*7+$_player_cy*13)%30</eval>
		<!--縦決定-->
		<!--本体<80なら下向き-->
		<repeat><times>$_self_cy-lt80</times>
			<eval name="RANDOM">$RANDOM+15</eval>
		</repeat>
		<!--本体>160なら上向き-->
		<repeat><times>$_self_cy-gt160</times>
			<eval name="RANDOM">$RANDOM-15</eval>
		</repeat>

		<!--横決定-->
		<!--本体 < 240なら間違いなく右-->
		<!--本体 > 400なら間違いなく左-->
		<!--そうでなければ自機から逃げる方向-->
		<repeat><times>$_self_cx-gt400</times>
			<eval name="RANDOM">360-$RANDOM</eval>
		</repeat>
		<repeat><times>(1-($_self_cx-gt400))*($_self_cx-gt240)*($_player_cx-gt$_self_cx)</times>
			<eval name="RANDOM">360-$RANDOM</eval>
		</repeat>
		<changeDirection>
			<direction type="absolute">$RANDOM</direction><term>1</term>
		</changeDirection>
		<changeSpeed>
			<speed>1.4</speed><term>10</term>
		</changeSpeed>
		<wait>10</wait>

		<aRef l="enemy_bullet_action8"><p>64</p></aRef>
		<fireRef label="stageC_bossTmp02_fire03A">
		<param>0.9+($__temp_grank*0.2)</param>
		</fireRef>
		<fireRef label="stageC_bossTmp02_fire03B">
		<param>1.2+($__temp_grank*0.2)</param>
		</fireRef>
		<fireRef label="stageC_bossTmp02_fire03B">
		<param>1.5+($__temp_grank*0.2)</param>
		</fireRef>
		<repeat><times>$__temp_grank-gt0</times>
			<fireRef label="stageC_bossTmp02_fire03B">
			<param>1.8+($__temp_grank*0.2)</param>
			</fireRef>
		</repeat>
		<repeat><times>$__temp_grank-gt1</times>
			<fireRef label="stageC_bossTmp02_fire03B">
			<param>2.1+($__temp_grank*0.2)</param>
			</fireRef>
		</repeat>
		<repeat><times>4</times>
			<wait>5</wait>
			<fireRef label="stageC_bossTmp02_fire03B">
			<param>0.9+($__temp_grank*0.2)</param>
			</fireRef>
			<fireRef label="stageC_bossTmp02_fire03B">
			<param>1.2+($__temp_grank*0.2)</param>
			</fireRef>
			<fireRef label="stageC_bossTmp02_fire03B">
			<param>1.5+($__temp_grank*0.2)</param>
			</fireRef>
			<repeat><times>$__temp_grank-gt0</times>
				<fireRef label="stageC_bossTmp02_fire03B">
				<param>1.8+($__temp_grank*0.2)</param>
				</fireRef>
			</repeat>
			<repeat><times>$__temp_grank-gt1</times>
				<fireRef label="stageC_bossTmp02_fire03B">
				<param>2.1+($__temp_grank*0.2)</param>
				</fireRef>
			</repeat>
		</repeat>

		<aRef l="enemy_bullet_action8"><p>64</p></aRef>
		<repeat><times>2+($__temp_grank-gt1)*2+($__temp_grank-gt2)+($__temp_grank-gt3)</times>
			<wait>5</wait>
			<fireRef label="stageC_bossTmp02_fire03B">
			<param>0.9+($__temp_grank*0.2)</param>
			</fireRef>
			<fireRef label="stageC_bossTmp02_fire03B">
			<param>1.2+($__temp_grank*0.2)</param>
			</fireRef>
			<fireRef label="stageC_bossTmp02_fire03B">
			<param>1.5+($__temp_grank*0.2)</param>
			</fireRef>
			<repeat><times>$__temp_grank-gt0</times>
				<fireRef label="stageC_bossTmp02_fire03B">
				<param>1.8+($__temp_grank*0.2)</param>
				</fireRef>
			</repeat>
			<repeat><times>$__temp_grank-gt1</times>
				<fireRef label="stageC_bossTmp02_fire03B">
				<param>2.1+($__temp_grank*0.2)</param>
				</fireRef>
			</repeat>
		</repeat>
		<w>21-(($__temp_grank-gt1)*2+($__temp_grank-gt2)+($__temp_grank-gt3))*5</w>
		<changeSpeed>
			<speed>0</speed><term>10</term>
		</changeSpeed>
		<wait>29</wait>
</action>

<action  label="stageC_bossTmp02_subactionMOVE">
		<!--移動方向決定ルーチン-->
		<eval name="RANDOM">75+($_player_cx*7+$_player_cy*13)%30</eval>
		<repeat><times>$_self_cy-lt80</times>
			<eval name="RANDOM">$RANDOM+15</eval>
		</repeat>
		<!--本体>160なら上向き-->
		<repeat><times>$_self_cy-gt160</times>
			<eval name="RANDOM">$RANDOM-15</eval>
		</repeat>
		<repeat><times>$_self_cx-gt400</times>
			<eval name="RANDOM">360-$RANDOM</eval>
		</repeat>
		<repeat><times>(1-($_self_cx-gt400))*($_self_cx-gt240)*($_player_cx-lt$_self_cx)</times>
			<eval name="RANDOM">360-$RANDOM</eval>
		</repeat>
		<changeDirection>
			<direction type="absolute">$RANDOM</direction><term>1</term>
		</changeDirection>
		<changeSpeed>
			<speed>2.0</speed><term>10</term>
		</changeSpeed>
		<wait>35</wait>
		<changeSpeed>
			<speed>0</speed><term>10</term>
		</changeSpeed>
		<wait>70</wait>
</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>170</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="item">0</eval>

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

	<eval name="ch_vital">850</eval> <!-- 元は 900 -->
	<eval name="ad_vital">500</eval>
	<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_b4_01"><p>90</p><p>0</p><p>30</p><p>1</p><p>$item%4</p><p>$ch_vital</p></createRef>
	<createRef label="mahoujin_create_b4_02"><p>-90</p><p>0</p><p>25</p><p>-1</p><p>($item+1)%4</p><p>$ch_vital</p></createRef>
	<w>10</w>
	<createRef label="mahoujin_create_b4_03"><p>135</p><p>0</p><p>24</p><p>1</p><p>($item+2)%4</p><p>$ch_vital</p></createRef>
	<createRef label="mahoujin_create_b4_04"><p>0</p><p>0</p><p>24</p><p>-1</p><p>($item+3)%4</p><p>$ch_vital</p></createRef>
	<evaladd name="item">1</evaladd>


	<w>100</w>

	<fRef l="enemy_fire_b_4_02dab"><p>0</p><p>180</p></fRef>
	<repeat><times>7</times>
		<w>3</w>
		<fRef l="enemy_fire_b_4_02ds"><p>45</p><p>180</p></fRef>
	</repeat>

	<w>100</w>

	<fRef l="enemy_fire_b_4_02ds"><p>22.5</p><p>60</p></fRef>
	<repeat><times>7</times>
		<w>3</w>
		<fRef l="enemy_fire_b_4_02ds"><p>45</p><p>60</p></fRef>
	</repeat>

	<repeat><times>$__temp_grank-gt2</times>
		<createRef label="mahoujin_create_b4_05"><p>0</p><p>$item%2</p><p>$ch_vital</p></createRef>
	</repeat>

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

	<chD><dir type="abs">89-198*($_player_cx-gt320)</dir><tm>1</tm></chD>
	<chS><sp type="abs">1.0</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>42</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>42+42*($__temp_grank-eq0)</w>
	</repeat>

	<chD><dir type="rel">180</dir><tm>1</tm></chD>
	<chS><sp type="abs">1.0</sp><tm>15</tm></chS>
	<w>15</w>
	<chS><sp type="abs">0</sp><tm>15</tm></chS>
	<w>95</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>178</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> <!-- 元は 900 -->
	<eval name="ad_vital">600</eval>
	<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>0</p><p>0</p><p>25</p><p>1</p><p>$item%4</p><p>$ch_vital</p></createRef>
	<createRef label="mahoujin_create_b5_02"><p>145</p><p>0</p><p>20</p><p>-1</p><p>($item+1)%4</p><p>$ch_vital</p></createRef>
	<w>10</w>
	<createRef label="mahoujin_create_b5_03"><p>-45</p><p>0</p><p>36</p><p>-1</p><p>($item+2)%4</p><p>$ch_vital</p></createRef>
	<createRef label="mahoujin_create_b5_04"><p>90</p><p>0</p><p>36</p><p>1</p><p>($item+3)%4</p><p>$ch_vital</p></createRef>
	<w>10</w>
	<createRef label="mahoujin_create_b5_05"><p>120</p><p>0</p><p>20</p><p>1</p><p>0</p><p>$ch_vital</p></createRef>
	<createRef label="mahoujin_create_b5_06"><p>-60</p><p>0</p><p>20</p><p>1</p><p>0</p><p>$ch_vital</p></createRef>
	<w>10</w>
	<evaladd name="item">1</evaladd>

	<w>100</w>

	<fRef l="enemy_fire_b_4_02dab"><p>0</p><p>180</p></fRef>
	<repeat><times>7</times>
		<w>3</w>
		<fRef l="enemy_fire_b_4_02ds"><p>45</p><p>180</p></fRef>
	</repeat>

	<w>100</w>

	<fRef l="enemy_fire_b_4_02ds"><p>22.5</p><p>60</p></fRef>
	<repeat><times>7</times>
		<w>3</w>
		<fRef l="enemy_fire_b_4_02ds"><p>45</p><p>60</p></fRef>
	</repeat>


	<chD><dir type="abs">89-198*($_player_cx-gt320)</dir><tm>1</tm></chD>
	<chS><sp type="abs">1.0</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>

	<createRef label="mahoujin_create_b5_07"><p>0</p><p>($item+1)%2</p><p>$ch_vital</p></createRef>

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

	<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*($__temp_grank-gt1)</times>
		<w>6</w>
		<fRef l="enemy_fire_b_3_02ds"><p>60</p><p>5</p></fRef>
	</repeat>
	<repeat><times>$__temp_grank-lt2</times>
		<w>30</w>
	</repeat>


	<chD><dir type="rel">180</dir><tm>1</tm></chD>
	<chS><sp type="abs">1.0</sp><tm>15</tm></chS>
	<w>15</w>
	<chS><sp type="abs">0</sp><tm>15</tm></chS>
	<w>105</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">1300*($_difficulty+1)</eval>
	<eval name="crystal">(16+$_difficulty*2)</eval>
	<eval name="red_crystal">44</eval>
	<eval name="multi4">960+($__grank-gt2)*90</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)*(10500+($__grank*200))-($__twins_set-eq1)*($_twinstype-eq3)*(800+($__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*6000)</p><p>$__main_boss_prate2</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">1300*($_difficulty+1)</eval>
	<eval name="crystal">(18+$_difficulty*2)</eval>
	<eval name="red_crystal">44</eval>
	<eval name="multi4">1100+($__grank-gt2)*90+($__grank-gt3)*90</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">13700+($__grank*300)-($__twins_set-eq1)*(10000+($__grank*200))-($__twins_set-eq1)*($_twinstype-eq3)*(900+($__grank*200))</eval>

	<!-- *** 次の形態のボスの作成 *** -->
	<createRef label="enemy_create_main_boss">
		<p>$_self_cx</p><p>$_self_cy</p><p>$vital</p><p>0</p><p>150000+($__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">1300*($_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>

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

	<!-- *** ボスの第３形態までスコアアイテム数146以上でsecretへ *** -->
<!--
	<debugstr><string>boss-Secret Judge</string></debugstr>
	<debugval><num>$__item_count</num></debugval>
-->
	<eval name="base">145</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">16200+($__grank*300)-($__twins_set-eq1)*(10500+($__grank*200))-($__twins_set-eq1)*($_twinstype-eq3)*(2400+($__grank*200))</eval>

		<createRef label="enemy_create_main_boss">
			<p>$_self_cx</p><p>$_self_cy</p><p>$vital</p><p>0</p><p>350000+($__grank*20000)</p><p>$__main_boss_prate4</p>
		</createRef>
	</repeat>
	<repeat><times>1-(($__item_count-gt$base)*($_stagemisscount-eq0))</times>
		<!-- *** 形態数4 *** -->
		<eval name="vital">16200+($__grank*300)-($__twins_set-eq1)*(10500+($__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>200000+($__grank*10000)</p><p>$__main_boss_prate4</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">1700*($_difficulty+1)</eval>
	<eval name="crystal">(22+$_difficulty*2)</eval>
	<eval name="red_crystal">50</eval>
	<eval name="multi4">1300+($__grank-gt2)*60+($__grank-gt3)*80</eval>
	<eval name="distance">$1</eval>

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

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

<revenge label="stage_main_boss_05_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">50</eval>
	<eval name="multi4">1300+($__grank-gt2)*60+($__grank-gt3)*80</eval>
	<eval name="distance">$1</eval>

	<!-- Enemy Magic Break -->
	<eval name="emb_prate">-14000-($__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">150000+($__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>
