#e
#Title[uX^[H[W2010v]
#Text[1969
1970
2008
ǂꂪD݁H]
#BGM[.\..\bgm\bgm.wav]
#BackGround[User]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main{
	
	@Initialize{
		imgBoss = imgBoss_Star;
		InitializeData();
		InitializeAction();
		
		SetLife(10);
		SetDurableSpellCard();
		SetMovePosition03(CenterX,MinY + 130,20,4);
		SetEnemyMarker(true);
		
		TMain();
	}
	
	@MainLoop{
		yield;
	}
	
	@DrawLoop{
		DrawBoss(imgBoss);
	}
	
	@Finalize{
		FinalizeData();
	}
	
	task TMain(){
		FWait(60);
		
		DeclareSpell();
		
		Atack();
		SAlpha();
	}
	
	function DeclareSpell(){
		SetScore(2600000);
		SetTimer(80);
		CutIn(KOUMA,"uX^[H[W2010v",NULL,0,0,0,0);
		FWait(180);
	}
	
	task Atack(){
		let angle = 0;
		let color = 0;
		let speed = 1;
		let rad = 0;
		
		loop{
			Star(GetX() + rad * cos(angle + color * 60),GetY() + rad * sin(angle + color * 60),speed,color);
			color += 1;
			speed += 0.4;
			rad = 48;
			FWait( 60 * 77 / 7 );
		}
	}
	
	task Star(x,y,speed,color){
		let angle  = 0;
		let count = 0;
		
		loop{
			angle  = -color * 360 / 7;
			count = 0;
			
			loop{
				if(count % 26 < 2){
					ascent(i in 0..5){
						CreateShot01(x,y,speed + (count % 26) * 0.035,angle  + i * 360 / 5,StarS[color],6);
					}
				}
				
				angle  += 2.05;
				count += 1;
				
				yield;
			}
		}
	}
	
	task SAlpha(){
		let alpha = 255;
		let aalpha = 128;
		
		loop(180){
			alpha -= (255 - aalpha) / 120;
			SetAlpha(alpha);
			yield;
		}
	}
	
	#include_function ".\initialize.txt"
	#include_function ".\..\lib\lib_anime_sangetusei.txt"
	
	#include_function ".\..\lib\lib_obj.txt"
	#include_function ".\..\lib\lib_value.txt"
	#include_function ".\..\lib\lib_shot.txt"
	#include_function ".\..\lib\lib_effect.txt"
}