#東方弾幕風
#Title[結晶「クリスタルワールド〜Lunaticβ」]
#Text[自分には無理でした…orz]
#ScriptVersion[2]
#PlayLevel[Normal]

script_enemy_main {
    let name ="結晶「クリスタルワールド」";
    let imgBoss   = "script\img\ExRumia.png";
    let frame     =  0;
    let angleBase = 90;

    @Initialize {
        CutIn(YOUMU, name, "", 0, 0, 0, 0);     

        SetX(GetCenterX);
        SetY(GetClipMinY + 120);
        SetLife(3500);
        SetTimer(47);
        SetScore(4000000);

        LoadGraphic(imgBoss);
        SetTexture(imgBoss);
        SetGraphicRect(0, 0, 63, 63);
    }

    @MainLoop {
        SetCollisionA(GetX, GetY, 24);
        SetCollisionB(GetX, GetY, 24);

          frame++;
        if(frame == 2) {           
            let angle = angleBase - 10;
            loop(10) {           
                 CreateShot01(GetX, GetY, 3, angleBase -90, BLUE23, 0);
                 CreateShot01(GetX, GetY, 3, angleBase -70, BLUE23, 0);   
                 CreateShot01(GetX, GetY, 3, angleBase -50, BLUE23, 0); 
                 CreateShot01(GetX, GetY, 3, angleBase -30, BLUE23, 0); 
                 CreateShot01(GetX, GetY, 3, angleBase -10, BLUE23, 0);  
                 CreateShot01(GetX, GetY, 3, angleBase +10, BLUE23, 0); 
                 CreateShot01(GetX, GetY, 3, angleBase +30, BLUE23, 0);  
                 CreateShot01(GetX, GetY, 3, angleBase +50, BLUE23, 0);  
                 CreateShot01(GetX, GetY, 3, angleBase +70, BLUE23, 0);  
                 CreateShot01(GetX, GetY, 3, angleBase +90, BLUE23, 0); 
                 CreateShot01(GetX, GetY, 3, angleBase +110, BLUE23, 0); 
                 CreateShot01(GetX, GetY, 3, angleBase +130, BLUE23, 0); 
                 CreateShot01(GetX, GetY, 3, angleBase +150, BLUE23, 0); 
                 CreateShot01(GetX, GetY, 3, angleBase +170, BLUE23, 0);  
                 CreateShot01(GetX, GetY, 3, angleBase +190, BLUE23, 0); 
                 CreateShot01(GetX, GetY, 3, angleBase +210, BLUE23, 0); 
                 CreateShot01(GetX, GetY, 3, angleBase +230, BLUE23, 0); 
                 CreateShot01(GetX, GetY, 3, angleBase +250, BLUE23, 0); 
                 CreateShot01(GetX, GetY, 3, angleBase +270, BLUE23, 0); 
 if(angle > 800){
                 CreateShot01(GetX, GetY, 4, angleBase -80, WHITE23, 0);
                 CreateShot01(GetX, GetY, 4, angleBase -60, WHITE23, 0);   
                 CreateShot01(GetX, GetY, 4, angleBase -40, WHITE23, 0); 
                 CreateShot01(GetX, GetY, 4, angleBase -20, WHITE23, 0); 
                 CreateShot01(GetX, GetY, 4, angleBase , WHITE23, 0);  
                 CreateShot01(GetX, GetY, 4, angleBase +20, WHITE23, 0); 
                 CreateShot01(GetX, GetY, 4, angleBase +40, WHITE23, 0);  
                 CreateShot01(GetX, GetY, 4, angleBase +60, WHITE23, 0);  
                 CreateShot01(GetX, GetY, 4, angleBase +80, WHITE23, 0);  
                 CreateShot01(GetX, GetY, 4, angleBase +100, WHITE23, 0); 
                 CreateShot01(GetX, GetY, 4, angleBase +120, WHITE23, 0); 
                 CreateShot01(GetX, GetY, 4, angleBase +140, WHITE23, 0); 
                 CreateShot01(GetX, GetY, 4, angleBase +160, WHITE23, 0); 
                 CreateShot01(GetX, GetY, 4, angleBase +180, WHITE23, 0);  
                 CreateShot01(GetX, GetY, 4, angleBase +200, WHITE23, 0); 
                 CreateShot01(GetX, GetY, 4, angleBase +220, WHITE23, 0); 
                 CreateShot01(GetX, GetY, 4, angleBase +240, WHITE23, 0); 
                 CreateShot01(GetX, GetY, 4, angleBase +260, WHITE23, 0); 
                 CreateShot01(GetX, GetY, 4, angleBase +280, WHITE23, 0); 
		 
            }
if(angle > 1200){
                 CreateShot01(GetX, GetY, 4, angleBase , RED03, 0);
                 CreateShot01(GetX, GetY, 3, angleBase -60, RED23, 0);   
                 CreateShot01(GetX, GetY, 4, angleBase -120, RED03, 0); 
                 CreateShot01(GetX, GetY, 3, angleBase -180, RED23, 0); 
                 CreateShot01(GetX, GetY, 4, angleBase +120, RED03, 0);  
                 CreateShot01(GetX, GetY, 3, angleBase +60, RED23, 0); 

            }
if(angle > 1600){
                 CreateShot01(GetX, GetY, 3, angleBase , GREEN23, 0);
                 CreateShot01(GetX, GetY, 3, angleBase +10, GREEN23, 0);   
                 CreateShot01(GetX, GetY, 3, angleBase +20, GREEN23, 0); 
                 CreateShot01(GetX, GetY, 3, angleBase -180, GREEN23, 0); 
                 CreateShot01(GetX, GetY, 3, angleBase -170, GREEN23, 0);  
                 CreateShot01(GetX, GetY, 3, angleBase -160, GREEN23, 0); 
                 
            }
                 angle += 10;
            }
            angleBase += 8;
        } else if(frame == 10) {
            let angle = angleBase - 10;
            loop(1) {         
                 CreateShot01(GetX, GetY, 3, angleBase -36, AQUA23, 0);
                 CreateShot01(GetX, GetY, 3, angleBase -72, AQUA23, 0);   
                 CreateShot01(GetX, GetY, 3, angleBase -108, AQUA23, 0); 
                 CreateShot01(GetX, GetY, 3, angleBase -144, AQUA23, 0); 
                 CreateShot01(GetX, GetY, 3, angleBase -180, AQUA23, 0);  
                 CreateShot01(GetX, GetY, 3, angleBase +36, AQUA23, 0); 
                 CreateShot01(GetX, GetY, 3, angleBase +72, AQUA23, 0);  
                 CreateShot01(GetX, GetY, 3, angleBase +108, AQUA23, 0);  
                 CreateShot01(GetX, GetY, 3, angleBase +144, AQUA23, 0);  
                 CreateShot01(GetX, GetY, 3, angleBase, AQUA23, 0); 
                                        
                angle += 10;
            }            
            angleBase += 8;
            frame = 0;
        }
    }

    @DrawLoop {
        DrawGraphic(GetX, GetY);
    }

    @Finalize {
        DeleteGraphic(imgBoss);
    }
}