Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #TouhouDanmakufu
- #Title [Nonspell]
- #Text[Sakuya thinks you're a wimp and goes EZ MODO]
- #Player[FREE]
- #ScriptVersion [2]
- script_enemy_main {
- let csd = GetCurrentScriptDirectory;
- let sakuya = csd ~ "img/boss_sakuya.png";
- let cut = csd ~ "img/cutin.png";
- let bg = csd ~ "img/bg.png";
- let shot = csd ~ "sound/tan.wav";
- let shin = csd ~ "sound/ring.wav";
- let f = 0;
- let f2 = 0;
- #include_function ".\SHOT_REPLACE\shot_replace.dnh";
- @Initialize{
- shotinit;
- SetLife(1000);
- SetTimer(60);
- MagicCircle(false);
- SetMovePosition01(GetCenterX,120,5);
- LoadGraphic(sakuya);
- LoadSE(shot);
- LoadSE(shin);
- mainTask;
- }
- @MainLoop{
- SetCollisionA(GetX,GetY,32);
- SetCollisionB(GetX,GetY,16);
- yield;
- }
- @DrawLoop{
- SetTexture(sakuya);
- SetRenderState(ALPHA);
- SetAlpha(255);
- SetGraphicScale(1,1);
- SetGraphicAngle(0,0,0);
- if(int(GetSpeedX())==0) {
- if(f<10){SetGraphicRect(49,35,77,95);}
- if(f>=10 && f<20){SetGraphicRect(49,163,77,223);}
- if(f>=20 && f<30){SetGraphicRect(49,291,77,351);}
- }
- if(int(GetSpeedX())>0) {
- if(f2<10){SetGraphicRect(318,323,336,327);}
- if(f2>=10 && f2<20){SetGraphicRect(318,420,342,478);}
- if(f2>20){SetGraphicRect(318,420,342,478);}
- }
- if(int(GetSpeedX())<0) {
- if(f2<10){SetGraphicRect(300,35,326,95);}
- if(f2>=10 && f2<20){SetGraphicRect(300,163,326,223);}
- if(f2>20){SetGraphicRect(300,163,326,223);}
- }
- DrawGraphic(GetX,GetY);
- f++;
- f2++;
- if (f==30){f=0;}
- }
- @Finalize{
- DeleteGraphic(sakuya);
- DeleteMusic(bgm);
- }
- }
- task mainTask{
- wait(120);
- yield;
- fire;
- movement;
- }
- task movement{
- loop{
- SetMovePosition01(GetCenterX-100,120,5);
- wait(60);
- SetMovePosition01(GetCenterX+100,139,5);
- wait(60);
- SetMovePosition01(GetCenterX+20,300,5);
- wait(60);
- yield;
- }
- }
- task fire{
- let x = 0;
- let dir = 0;
- loop{
- CreateShot01(GetEnemyX,GetEnemyY,2,GetAngleToPlayer,BLUE32,0);
- CreateShot01(GetEnemyX,GetEnemyY,2,GetAngleToPlayer-20,RED32,0);
- CreateShot01(GetEnemyX,GetEnemyY,2,GetAngleToPlayer+20,GREEN32,0);
- PlaySE(shot);
- wait(5);
- while (x<40){
- CreateShotA(1,GetEnemyX,GetEnemyY,0);
- SetShotDataA(1,0,2,dir,0,0,2,AQUA32);
- SetShotDataA(1,60,2,dir,0.5,0,2,AQUA32);
- PlaySE(shin);
- FireShot(1);
- dir+=360/36;
- x++;
- }
- x=0;
- dir=0;
- wait(60);
- yield;
- }
- }
- function wait(w){
- loop(w){yield;}
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment