#東方弾幕風
#Title[ユナ通常弾〜Hard]
#Text[少しだけ難しいかもです。]
#ScriptVersion[2]

script_enemy_main {  
    let imgBoss   = "script\img\ExRumia.png";
    let frame     =  0;
    let angleBase = 90;

    @Initialize {
      
        SetX(GetCenterX);
        SetY(GetClipMinY + 120);
        SetLife(3000);
        SetTimer(47);
       

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

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

        frame++;
        if(frame == 3) {   

           SetShotDirectionType(PLAYER);        

            let angle = angleBase - 10;
            loop(2) {
            CreateShot01(GetX, GetY, 2, angleBase , WHITE22, 3);
            CreateShot01(GetX, GetY, 2, angleBase +20, WHITE22, 3);
            CreateShot01(GetX, GetY, 2, angleBase +40, WHITE22, 3);
            CreateShot01(GetX, GetY, 2, angleBase +60, WHITE22, 3);  
            
            CreateShot01(GetX, GetY,3 , angleBase , WHITE22, 1);
            CreateShot01(GetX, GetY, 3, angleBase +110, WHITE22, 1);
           
            CreateShot01(GetX, GetY, 2, angleBase -180, WHITE22, 2);
            CreateShot01(GetX, GetY, 2, angleBase -200, WHITE22, 2);
            CreateShot01(GetX, GetY, 2, angleBase -220, WHITE22, 2);
           
            CreateShot01(GetX, GetY, 3, angleBase -90, WHITE22, 1);
            CreateShot01(GetX, GetY, 3, angleBase -70, WHITE22, 1); 
            angleBase += 10;
            }
            angleBase += 8;
        } else if(frame == 10) {

 SetShotDirectionType(PLAYER);

            let angle = angleBase - 10;
          loop(1) {
            CreateShot01(GetX, GetY, 2, angle, WHITE03, 2);               
            CreateShot01(GetX, GetY, 2, angle -180, WHITE03, 2);    
            CreateShot01(GetX, GetY, 2, angle -90, WHITE03, 2);       
            CreateShot01(GetX, GetY, 2, angle +90, WHITE03, 2);       
            angle += 10;            

            }            
            angleBase += 8;
            frame = 0;
        }
    }

    @DrawLoop {
        DrawGraphic(GetX, GetY);
    }

    @Finalize {
        DeleteGraphic(imgBoss);
    }
}