#TouhouDanmakufu
#Title[Rumia's Arcanum "Double Black Death Wave And Particle"]
#Text[STOLEN FRUM YUKARI LOLZ. Rumia also has a cold.]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main{


	let ImgBoss="script\ExRumia\img\ExRumia.png"; 
	let frame = 0; 
	let frame2 = 0;
	let lol = 0;
	let angle = 0;
	let angleAcc = 0;
	let sneeze = GetCurrentScriptDirectory~"sneeze.mp3";
	let radius = 0;
#include_function ".\lib\SHOT_REPLACE\shot_replace.dnh"
	let background = GetCurrentScriptDirectory~"patchybackground.png";
	@Initialize{
		SetLife(4200);
		SetTimer(75);
		shotinit;
		LoadSE(sneeze);
		SetInvincibility(360);
		LoadGraphic(ImgBoss);
		CutIn(KOUMA, "Rumia's Arcanum "\""Double Black Death Wave and Particle"\", GetCurrentScriptDirectory~"rumia.png", 0, 0, 128, 256);
		SetMovePosition02(GetCenterX, GetCenterY -120, 120); 
		SetDamageRate(99, 0);
		SetScore(100000);
	LoadGraphic(background);
	}
	
	@MainLoop{
	SetCollisionA(GetX, GetY, 32);
	SetCollisionB(GetX, GetY, 16);
	frame++; 
	frame2++;
	lol++;

	if(lol==190 || GetTimer==31){
DeleteEnemyShotToItem(ALL);
PlaySE(sneeze);
}
	if(frame==120){
	
		loop(3){
			CreateShot01(GetX + radius*cos(angle), GetY + radius*sin(angle), 3, angle, PURPLE22, 10);
			angle += 360/3;
			
		}
		angle += angleAcc;
		angleAcc += 0.05;
		frame = 119;
	}
	
	if(frame2>=-140 && frame2 <=110){
		radius+=1.1;
	}
	if(frame2>=111 && frame2 <= 360){
		radius-=1.1;
	}
	if(frame2==360){
		frame2=-141;
	}
	}


	@DrawLoop{
		SetTexture(ImgBoss);
                SetRenderState(ALPHA);
                SetAlpha(255);  
                SetGraphicScale(1,1);
                SetGraphicAngle(0,0,0);

                if(GetSpeedX==0){
                         SetGraphicRect(0,0,64,64); }
                        
 
                if(GetSpeedX>0){
                        SetGraphicRect(190, 126, 256, 64);
			}
 
                if(GetSpeedX<0){
                        
                        SetGraphicRect(128,128,186,64); }
                      
 
                DrawGraphic(GetX,GetY);
	}
		
let y = 0;

@BackGround{
   SetTexture(background);
   SetGraphicRect(0, 0 - y, 512, 512 - y);
   DrawGraphic(GetCenterX, GetCenterY);
   y++;
}
	@Finalize
	{
		DeleteGraphic(ImgBoss);
	}
}
