Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.32 KB | None | 0 0
  1. #TouhouDanmakufu
  2. #Title[Koishi Nonspell 1]
  3. #Text[Nonspell]
  4. #PlayLevel[Extra]
  5. #Player[FREE]
  6. #ScriptVersion[2]
  7.  
  8. script_enemy_main
  9. {
  10. #include_function ".\Library.dnh"
  11.  
  12. let KoishiSprite = csd~"img/KoishiSprite.png";
  13.  
  14. @Initialize
  15. {
  16. PlayMusic(csd~"Hartmann's Youkai Girl.mp3");
  17. LoadUserShotData(csd~"Shot.txt");
  18. LoadGraphic(KoishiSprite);
  19. SetLife(3000);
  20. SetEnemyMarker(true);
  21. SetDamageRate(50,50);
  22. SetTimer(46);
  23.  
  24. SetEffectForZeroLife(60,0,0);
  25. SetMovePosition02(GetCenterX,GetCenterY-120,60);
  26.  
  27.  
  28. MainTask;
  29. Vulnerable;
  30. IdleAnimation;
  31. MoveAbout;
  32. }
  33.  
  34. task Vulnerable
  35. {
  36. Wait(1200);
  37. SetDamageRate(50,50);
  38. }
  39.  
  40.  
  41. task MainTask
  42. {
  43. Wait(60);
  44. SetColor(64,255,64);
  45. Concentration01(120);
  46. FireAnimation;
  47. SetColor(255,255,255);
  48. PlaySE(Charge1);
  49. Wait(120);
  50.  
  51. loop
  52. {
  53. let angle = rand(0,360);
  54. ascent(i in 0..38)
  55. {
  56.  
  57. CreateShot01(GetX,GetY,2,angle+i*10,250,10);
  58. CreateShot01(GetX,GetY,3,angle+i*10,251,10);
  59. }
  60. PlaySE(Shot2);
  61. Wait(30);
  62. }
  63. }
  64.  
  65. task MoveAbout
  66. {
  67. loop
  68. {
  69. Wait(250);
  70. SetMovePositionRandom01(64,64,1,GetClipMinX+64,GetClipMinY+64,GetClipMaxX-64,GetClipMinY+128);
  71. MoveAnimation;
  72. Wait(150);
  73. }
  74. }
  75.  
  76. @MainLoop
  77. {
  78. SetCollisionA(GetX,GetY,24);
  79. SetCollisionB(GetX,GetY,24);
  80. yield;
  81. }
  82.  
  83. let BR = [0,0,64,64];
  84. let bossflip = 0;
  85.  
  86. let ani = 0;
  87.  
  88. task MoveAnimation
  89. {
  90. ani++;
  91. let currentani = ani;
  92.  
  93. if (GetSpeedX > 0)
  94. {
  95. bossflip = 0;
  96. loop(8){if(currentani==ani){BR = [0,64,64,128]; yield;}}
  97. loop(8){if(currentani==ani){BR = [64,64,128,128]; yield;}}
  98. loop(8){if(currentani==ani){BR = [128,64,192,128]; yield;}}
  99. while(GetSpeed>0 && currentani==ani){BR = [192,64,256,128]; yield;}
  100. loop(8){if(currentani==ani){BR = [128,64,192,128]; yield;}}
  101. loop(8){if(currentani==ani){BR = [64,64,128,128]; yield;}}
  102. }
  103. else
  104. {
  105. if (GetSpeedX < 0)
  106. {
  107. bossflip = 1;
  108. loop(8){if(currentani==ani){BR = [0,64,64,128]; yield;}}
  109. loop(8){if(currentani==ani){BR = [64,64,128,128]; yield;}}
  110. loop(8){if(currentani==ani){BR = [128,64,192,128]; yield;}}
  111. while(GetSpeed>0 && currentani==ani){BR = [192,64,256,128]; yield;}
  112. loop(8){if(currentani==ani){BR = [128,64,192,128]; yield;}}
  113. loop(8){if(currentani==ani){BR = [64,64,128,128]; yield;}}
  114. }
  115. }
  116. if(currentani==ani){IdleAnimation;}
  117. }
  118.  
  119. task IdleAnimation
  120. {
  121. ani++;
  122. let currentani = ani;
  123. while(currentani==ani)
  124. {
  125. loop(8){if(currentani==ani){BR = [0,0,64,64]; yield;}}
  126. loop(8){if(currentani==ani){BR = [64,0,128,64]; yield;}}
  127. loop(8){if(currentani==ani){BR = [128,0,192,64]; yield;}}
  128. loop(8){if(currentani==ani){BR = [192,0,256,64]; yield;}}
  129. loop(8){if(currentani==ani){BR = [128,0,192,64]; yield;}}
  130. loop(8){if(currentani==ani){BR = [64,0,128,64]; yield;}}
  131. }
  132. }
  133.  
  134. task FireAnimation
  135. {
  136. ani++;
  137. let currentani = ani;
  138. while(currentani==ani)
  139. {
  140. bossflip = 0;
  141. loop(8){if(currentani==ani){BR = [0,192,64,128]; yield;}}
  142. loop(8){if(currentani==ani){BR = [64,192,128,128]; yield;}}
  143. loop(8){if(currentani==ani){BR = [128,192,192,128]; yield;}}
  144. loop(999){if(currentani==ani){BR = [192,192,256,128]; yield;}}
  145. }
  146. }
  147.  
  148. @DrawLoop
  149. {
  150. SetAlpha(255);
  151. if (bossflip==0){SetGraphicScale(1,1);}
  152. if (bossflip==1){SetGraphicScale(-1,1);}
  153. SetColor(255,255,255);
  154. SetGraphicAngle(0,0,0);
  155. SetTexture(KoishiSprite);
  156. SetGraphicRect(BR[0],BR[1],BR[2],BR[3]);
  157. DrawGraphic(GetX,GetY);
  158. }
  159.  
  160. @Finalize
  161. {
  162. DeleteGraphic(KoishiSprite);
  163. }
  164.  
  165. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement