Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #TouhouDanmakufu
- #Title[Koishi Nonspell 2]
- #Text[Nonspell]
- #PlayLevel[Extra]
- #Player[FREE]
- #ScriptVersion[2]
- script_enemy_main
- {
- #include_function ".\Library.dnh"
- let KoishiSprite = csd~"img/KoishiSprite.png";
- @Initialize
- {
- PlayMusic(csd~"Hartmann's Youkai Girl.mp3");
- LoadUserShotData(csd~"Shot.txt");
- LoadGraphic(KoishiSprite);
- SetLife(3000);
- SetEnemyMarker(true);
- SetDamageRate(50, 50);
- SetTimer(81);
- SetEffectForZeroLife(60,0,0);
- SetMovePosition02(GetCenterX,GetCenterY-120,60);
- MainTask;
- Vulnerable;
- IdleAnimation;
- MoveAbout;
- }
- task Vulnerable
- {
- Wait(1200);
- SetDamageRate(50,50);
- }
- task MainTask
- {
- Wait(60);
- SetColor(64,255,64);
- Concentration01(120);
- FireAnimation;
- SetColor(255,255,255);
- PlaySE(Charge1);
- Wait(120);
- loop
- {
- ascent(z in 0..20)
- {
- CreateLaserB(0,496,8,3,60);
- SetLaserDataB(0,0,0,24,0,z*18+GetAngleToPlayer,2,z*18,0.5);
- PlaySE(Laser1);
- SetShotKillTime(0,125);
- ascent(i in 0..12)
- {
- CreateShotA(1,0,0,10);
- SetShotDataA(1,0,0,0,-0.1,0.02,3,13);
- AddShot(60+i*3,0,1,48);
- }
- FireShot(0);
- CreateLaserB(0,196,8,5,60);
- SetLaserDataB(0,0,0,24,0,z*18+GetAngleToPlayer,-2,z*18+GetAngleToPlayer,-2);
- SetShotKillTime(0,125);
- ascent(i in 0..12)
- {
- CreateShotA(1,0,0,10);
- SetShotDataA(1,0,0,0,0.1,0.02,3,15);
- AddShot(60+i*3,0,1,100);
- }
- FireShot(0);
- }
- Wait(180);
- ascent(z in 0..20)
- {
- CreateLaserB(0,496,8,3,60);
- SetLaserDataB(0,0,0,24,0,z*18+GetAngleToPlayer,2,z*18,-0.5);
- PlaySE(Laser1);
- SetShotKillTime(0,125);
- ascent(i in 0..12)
- {
- CreateShotA(1,0,0,10);
- SetShotDataA(1,0,0,0,-0.1,0.02,3,13);
- AddShot(60+i*3,0,1,48);
- }
- FireShot(0);
- CreateLaserB(0,196,8,5,60);
- SetLaserDataB(0,0,0,24,0,z*18+GetAngleToPlayer,-2,z*18+GetAngleToPlayer,2);
- SetShotKillTime(0,125);
- ascent(i in 0..12)
- {
- CreateShotA(1,0,0,10);
- SetShotDataA(1,0,0,0,0.1,0.02,3,15);
- AddShot(60+i*3,0,1,100);
- }
- FireShot(0);
- }
- Wait(180);
- }
- }
- task MoveAbout
- {
- loop
- {
- Wait(250);
- SetMovePositionRandom01(64,64,0.1,GetClipMinX+64,GetClipMinY+64,GetClipMaxX-64,GetClipMinY+128);
- MoveAnimation;
- Wait(150);
- }
- }
- @MainLoop
- {
- SetCollisionA(GetX,GetY,24);
- SetCollisionB(GetX,GetY,24);
- yield;
- }
- let BR = [0,0,64,64];
- let bossflip = 0;
- let ani = 0;
- task MoveAnimation
- {
- ani++;
- let currentani = ani;
- if (GetSpeedX > 0)
- {
- bossflip = 0;
- loop(8){if(currentani==ani){BR = [0,64,64,128]; yield;}}
- loop(8){if(currentani==ani){BR = [64,64,128,128]; yield;}}
- loop(8){if(currentani==ani){BR = [128,64,192,128]; yield;}}
- while(GetSpeed>0 && currentani==ani){BR = [192,64,256,128]; yield;}
- loop(8){if(currentani==ani){BR = [128,64,192,128]; yield;}}
- loop(8){if(currentani==ani){BR = [64,64,128,128]; yield;}}
- }
- else
- {
- if (GetSpeedX < 0)
- {
- bossflip = 1;
- loop(8){if(currentani==ani){BR = [0,64,64,128]; yield;}}
- loop(8){if(currentani==ani){BR = [64,64,128,128]; yield;}}
- loop(8){if(currentani==ani){BR = [128,64,192,128]; yield;}}
- while(GetSpeed>0 && currentani==ani){BR = [192,64,256,128]; yield;}
- loop(8){if(currentani==ani){BR = [128,64,192,128]; yield;}}
- loop(8){if(currentani==ani){BR = [64,64,128,128]; yield;}}
- }
- }
- if(currentani==ani){IdleAnimation;}
- }
- task IdleAnimation
- {
- ani++;
- let currentani = ani;
- while(currentani==ani)
- {
- loop(8){if(currentani==ani){BR = [0,0,64,64]; yield;}}
- loop(8){if(currentani==ani){BR = [64,0,128,64]; yield;}}
- loop(8){if(currentani==ani){BR = [128,0,192,64]; yield;}}
- loop(8){if(currentani==ani){BR = [192,0,256,64]; yield;}}
- loop(8){if(currentani==ani){BR = [128,0,192,64]; yield;}}
- loop(8){if(currentani==ani){BR = [64,0,128,64]; yield;}}
- }
- }
- task FireAnimation
- {
- ani++;
- let currentani = ani;
- while(currentani==ani)
- {
- bossflip = 0;
- loop(8){if(currentani==ani){BR = [0,192,64,128]; yield;}}
- loop(8){if(currentani==ani){BR = [64,192,128,128]; yield;}}
- loop(8){if(currentani==ani){BR = [128,192,192,128]; yield;}}
- loop(999){if(currentani==ani){BR = [192,192,256,128]; yield;}}
- }
- }
- @DrawLoop
- {
- SetAlpha(255);
- if (bossflip==0){SetGraphicScale(1,1);}
- if (bossflip==1){SetGraphicScale(-1,1);}
- SetColor(255,255,255);
- SetGraphicAngle(0,0,0);
- SetTexture(KoishiSprite);
- SetGraphicRect(BR[0],BR[1],BR[2],BR[3]);
- DrawGraphic(GetX,GetY);
- }
- @Finalize
- {
- DeleteGraphic(KoishiSprite);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement