Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #TouhouDanmakufu
- #Title[Yuyuko Encounter 1]
- #Text[]
- #Player[FREE]
- #ScriptVersion[2]
- script_enemy_main{
- let CSD = GetCurrentScriptDirectory;
- let yuyutex = CSD ~ "IMG\yuyuSprite.png";
- let bg = CSD ~ "IMG\stg6_bg.png";
- let shots = CSD ~ "System\mainShot.txt";
- let f = 0;
- let f2 = 0;
- let float = 0;
- let rotation = 0;
- let scale = 1;
- @Initialize{
- LoadGraphic(yuyutex);
- LoadUserShotData(shots);
- SetLife(4000);
- SetTimer(60);
- SetDamageRate(80,65);
- SetMovePosition01(GetCenterX,GetCenterY-100,3);
- SetInvincibility(120);
- mainTask;
- }
- @MainLoop{
- SetCollisionA(GetX,GetY,20);
- SetCollisionB(GetX,GetY,15);
- yield;
- }
- @DrawLoop{
- SetTexture(yuyutex);
- SetRenderState(ALPHA);
- SetAlpha(255);
- SetGraphicScale(1,1);
- SetGraphicAngle(0,0,0);
- if(int(GetSpeedX()) == 0){
- SetGraphicAngle(0,0,0);
- if(f<10){ SetGraphicRect(0,0,48,78); }
- if(f>=10 && f<20){ SetGraphicRect(48,0,96,78); }
- if(f>=20 && f<30){ SetGraphicRect(96,0,144,78); }
- if(f>=30 && f<40){ SetGraphicRect(144,0,192,78); }
- f2 = 0;
- }
- if(GetSpeedX() > 0){
- if(f2<5){ SetGraphicRect(0,78,48,156); }
- if(f2>=5 && f2<10){ SetGraphicRect(48,78,96,156); }
- if(f2>=10){ SetGraphicRect(96,78,144,156); }
- f2++;
- }
- if(GetSpeedX() < 0){
- SetGraphicAngle(180,0,0);
- if(f2<5){ SetGraphicRect(0,156,48,234); }
- if(f2>=5 && f2<10){ SetGraphicRect(48,156,96,234); }
- if(f2>=10 && f2<15){ SetGraphicRect(96,156,144,234); }
- if(f2>=20){ SetGraphicRect(144,156,192,234); }
- f2++;
- }
- DrawGraphic(GetX,GetY+5*sin(float));
- float+=3;
- f++;
- if(f==40){
- f = 0;
- }
- }
- @BackGround{
- }
- @Finalize{
- DeleteGraphic(yuyutex);
- }
- task mainTask{
- wait(80);
- movement;
- yellowSpiral;
- wait(120);
- spiralFire;
- yield;
- }
- task movement{
- loop{
- SetMovePositionRandom01(30,10,1,GetClipMinX+75,GetClipMinY+40,GetClipMaxX-75,GetClipMaxY-225);
- wait(180);
- yield;
- }
- }
- task yellowSpiral{
- let r = 30;
- let x = 0;
- let dir = 0;
- let dir2 = 180;
- let dirvel = 0.3;
- let spiralCount = 720;
- let count = spiralCount/10;
- loop{
- while(x < count){
- PlaySE(CSD ~ "SFX\shotb.wav");
- CreateShotA(1,GetEnemyX+r*cos(dir),GetEnemyY+r*sin(dir),0);
- SetShotDataA(1,0,2,dir,dirvel*-1,0,1,207);
- wait(1);
- FireShot(1);
- CreateShotA(2,GetEnemyX+r*cos(dir2),GetEnemyY+r*sin(dir2),0);
- SetShotDataA(2,0,2,dir2,dirvel,0,1,207);
- wait(1);
- FireShot(2);
- dir+=spiralCount/count;
- x++;
- dir2+=spiralCount/count;
- x++;
- }
- //reset x
- x = 0;
- wait(90);
- yield;
- }
- }
- task spiralFire{
- let x = 0;
- let x2 = 0;
- let rad1 = 50;
- let rad2 = 50;
- let spiralCounts = 16;
- let delaying = 10;
- loop{
- loop(spiralCounts){
- PlaySE(CSD ~ "SFX\shota.wav");
- ascent(i in 0..4){
- CreateShot01(GetX+rad1*cos(360/4*i+x),GetY+rad1*sin(360/4*i+x),2,360/4*i+x,211,delaying);
- //CreateShot01(GetX+rad1*cos(360/4*i+x),GetY+rad1*sin(360/4*i+x),2,360/4*i+x,237,delaying);
- }
- x-=11;
- rad1-=2;
- if(rad1 <= -50){
- rad1 = 50;
- }
- wait(4);
- }
- //butterfly burst
- wait(120);
- loop(spiralCounts){
- PlaySE(CSD ~ "SFX\shota.wav");
- ascent(z in 0..4){
- CreateShot01(GetX+rad2*cos(360/4*z+x2),GetY+rad2*sin(360/4*z+x2),2,360/4*z+x2,211,delaying);
- //CreateShot01(GetX+rad2*cos(360/4*z+x2),GetY+rad2*sin(360/4*z+x2),2,360/4*z+x2,237,delaying);
- }
- x2+=11;
- rad2-=2;
- if(rad1 <= -50){
- rad1 = 50;
- }
- wait(4);
- }
- x = 0;
- x2 = 0;
- rad1 = 50;
- rad2 = 50;
- wait(60);
- }
- }
- function wait(w){
- loop(w){
- yield;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment