    #TouhouDanmakufu
    #Title[Omniscience Sign - Kami's All-Seeing Eye ]
    #Text[lol i dunno]
    #Player[FREE]
    #ScriptVersion[2]
     
    script_enemy_main {
     
            let CSD = GetCurrentScriptDirectory;
     
            let imgBoss = CSD ~ "system\aura.png";
            let cut = CSD ~ "system\mcircle.png";
            let bg = CSD ~ "system\effect_circle.png";
     
            let f = 0;
            let f2 = 0;
			let xp=0;
			let pxp=0;
	 
            function wait(t){loop(t){yield;}}
     
     
        @Initialize {
            SetLife(5000);
            SetEnemyMarker(true);
            MagicCircle(true);
            SetTimer(60);
            LoadGraphic(imgBoss);
            LoadGraphic(cut);
            LoadGraphic(bg);
            SetMovePosition01(224, 80, 5);
           
            CutIn(YOUMU, "Omniscience Sign - Kami's All-Seeing Eye", cut, 0, 0, 256, 512);
     
            mainTask;
     
        }
     
        @MainLoop {
            SetCollisionA(GetX, GetY, 32);
            SetCollisionB(GetX, GetY, 24);
            yield; 
     
    }    
     
        @DrawLoop {SetTexture(imgBoss);
                    SetRenderState(ALPHA);
                    SetAlpha(255);
                    SetGraphicScale(5,5);
                    SetGraphicAngle(0,0,0);
                    pxp=xp;
					xp=GetPlayerX;
     
                    if(xp-pxp==0){
                            if(f<10){ SetGraphicRect(0,0,65,80); }
                            if(f>=10 && f<20){ SetGraphicRect(65,0,130,80); }
                            if(f>=20 && f<30){ SetGraphicRect(130,0,195,80); }
                            if(f>=30 && f<40){ SetGraphicRect(195,0,260,80); }
                            f2=0;
                    }
                   
                    if(xp-pxp>0){
                            if(f2<5){ SetGraphicRect(0,80,65,130); }
                            if(f2>=5 && f2<10){ SetGraphicRect(65,80,130,130); }
                            if(f2>=10 && f2<15){ SetGraphicRect(130,80,195,130); }
                            if(f2>=15){ SetGraphicRect(195,80,260,130); }
                            f2++;
                    }
           
                    if(pxp-xp<0){
                            SetGraphicAngle(180,0,0);
                            if(f2<5){ SetGraphicRect(0,80,65,130); }
                            if(f2>=5 && f2<10){ SetGraphicRect(65,80,130,130); }
                            if(f2>=10 && f2<15){ SetGraphicRect(130,80,195,130); }
                            if(f2>=15){ SetGraphicRect(195,80,260,130); }
                            f2++;
     
                    }
     
                    DrawGraphic(GetX,GetY);
     
                    f++;
                    if(f==40){f=0;}
                                   
        }
     
        @Finalize {
            DeleteGraphic(imgBoss);
            DeleteGraphic(cut);
            DeleteGraphic(bg);
     
        }
     
        task mainTask{
            wait(10);
            Fire;
            yield;
     
    }
     
    task Fire{
     
     
    loop{
     
     
            CreateShotA(1, GetX, GetY, 0);
            SetShotDataA(1, 0, 6, 45, 1, 0, 0.2, AQUA03);
            ascent(i in 1..40){
                    CreateShotA(3, 0, 0, 0);
                    SetShotDataA_XY(3, 0, rand(2, 4), rand(4, -4), 0, 0, 0, 4, BLUE31);
                    AddShot(i*3, 1, 3, 0);
                   
            }
     
            CreateShotA(6, GetX, GetY, 120);
            SetShotDataA(6, 0, 6, 25, 1, 0, 0.2, RED03);
           
            CreateShotA(7, GetX, GetY, 120);
            SetShotDataA(7, 0, 6, 155, -1, 0, -0.2, RED03);
     
            CreateShotA(2, GetX, GetY, 0);
            SetShotDataA(2, 0, 6, 135, -1, 0, 0.2, AQUA03);
            ascent(i in 1..40){
            CreateShotA(4, 0, 0, 0);
            SetShotDataA_XY(4, 0, rand(-2, -4), rand(4, -4), 0, 0, 0, 4, BLUE31);
            AddShot(i*3, 2, 4, 0);
            }
     
            ascent(i in 1..5){
                    CreateShot11(0, rand(0, 600), rand(0, 1.5), 0, PURPLE31, 120);
                    CreateShot11(450, rand(0, 600), rand(-1.5, 0), 0, PURPLE31, 120);
     
     
            }      
     
           
     
    FireShot(1);
    FireShot(2);
    FireShot(6);
    FireShot(7);
    wait(8);
     
    yield;
    }
    loop{yield;}
    }
    }
