Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.36 KB | None | 0 0
  1. #TouhouDanmakufu
  2. #Title[Koishi Nonspell 2]
  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(81);
  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. ascent(z in 0..20)
  54. {
  55. CreateLaserB(0,496,8,3,60);
  56. SetLaserDataB(0,0,0,24,0,z*18+GetAngleToPlayer,2,z*18,0.5);
  57. PlaySE(Laser1);
  58. SetShotKillTime(0,125);
  59.  
  60. ascent(i in 0..12)
  61. {
  62. CreateShotA(1,0,0,10);
  63. SetShotDataA(1,0,0,0,-0.1,0.02,3,13);
  64. AddShot(60+i*3,0,1,48);
  65. }
  66. FireShot(0);
  67.  
  68. CreateLaserB(0,196,8,5,60);
  69. SetLaserDataB(0,0,0,24,0,z*18+GetAngleToPlayer,-2,z*18+GetAngleToPlayer,-2);
  70. SetShotKillTime(0,125);
  71. ascent(i in 0..12)
  72. {
  73. CreateShotA(1,0,0,10);
  74. SetShotDataA(1,0,0,0,0.1,0.02,3,15);
  75. AddShot(60+i*3,0,1,100);
  76. }
  77. FireShot(0);
  78. }
  79.  
  80. Wait(180);
  81.  
  82. ascent(z in 0..20)
  83. {
  84. CreateLaserB(0,496,8,3,60);
  85. SetLaserDataB(0,0,0,24,0,z*18+GetAngleToPlayer,2,z*18,-0.5);
  86. PlaySE(Laser1);
  87. SetShotKillTime(0,125);
  88.  
  89. ascent(i in 0..12)
  90. {
  91. CreateShotA(1,0,0,10);
  92. SetShotDataA(1,0,0,0,-0.1,0.02,3,13);
  93. AddShot(60+i*3,0,1,48);
  94. }
  95. FireShot(0);
  96.  
  97. CreateLaserB(0,196,8,5,60);
  98. SetLaserDataB(0,0,0,24,0,z*18+GetAngleToPlayer,-2,z*18+GetAngleToPlayer,2);
  99. SetShotKillTime(0,125);
  100. ascent(i in 0..12)
  101. {
  102. CreateShotA(1,0,0,10);
  103. SetShotDataA(1,0,0,0,0.1,0.02,3,15);
  104. AddShot(60+i*3,0,1,100);
  105. }
  106. FireShot(0);
  107. }
  108.  
  109. Wait(180);
  110. }
  111. }
  112.  
  113. task MoveAbout
  114. {
  115. loop
  116. {
  117. Wait(250);
  118. SetMovePositionRandom01(64,64,0.1,GetClipMinX+64,GetClipMinY+64,GetClipMaxX-64,GetClipMinY+128);
  119. MoveAnimation;
  120. Wait(150);
  121. }
  122. }
  123.  
  124. @MainLoop
  125. {
  126. SetCollisionA(GetX,GetY,24);
  127. SetCollisionB(GetX,GetY,24);
  128. yield;
  129. }
  130.  
  131. let BR = [0,0,64,64];
  132. let bossflip = 0;
  133.  
  134. let ani = 0;
  135.  
  136. task MoveAnimation
  137. {
  138. ani++;
  139. let currentani = ani;
  140.  
  141. if (GetSpeedX > 0)
  142. {
  143. bossflip = 0;
  144. loop(8){if(currentani==ani){BR = [0,64,64,128]; yield;}}
  145. loop(8){if(currentani==ani){BR = [64,64,128,128]; yield;}}
  146. loop(8){if(currentani==ani){BR = [128,64,192,128]; yield;}}
  147. while(GetSpeed>0 && currentani==ani){BR = [192,64,256,128]; yield;}
  148. loop(8){if(currentani==ani){BR = [128,64,192,128]; yield;}}
  149. loop(8){if(currentani==ani){BR = [64,64,128,128]; yield;}}
  150. }
  151. else
  152. {
  153. if (GetSpeedX < 0)
  154. {
  155. bossflip = 1;
  156. loop(8){if(currentani==ani){BR = [0,64,64,128]; yield;}}
  157. loop(8){if(currentani==ani){BR = [64,64,128,128]; yield;}}
  158. loop(8){if(currentani==ani){BR = [128,64,192,128]; yield;}}
  159. while(GetSpeed>0 && currentani==ani){BR = [192,64,256,128]; yield;}
  160. loop(8){if(currentani==ani){BR = [128,64,192,128]; yield;}}
  161. loop(8){if(currentani==ani){BR = [64,64,128,128]; yield;}}
  162. }
  163. }
  164. if(currentani==ani){IdleAnimation;}
  165. }
  166.  
  167. task IdleAnimation
  168. {
  169. ani++;
  170. let currentani = ani;
  171. while(currentani==ani)
  172. {
  173. loop(8){if(currentani==ani){BR = [0,0,64,64]; yield;}}
  174. loop(8){if(currentani==ani){BR = [64,0,128,64]; yield;}}
  175. loop(8){if(currentani==ani){BR = [128,0,192,64]; yield;}}
  176. loop(8){if(currentani==ani){BR = [192,0,256,64]; yield;}}
  177. loop(8){if(currentani==ani){BR = [128,0,192,64]; yield;}}
  178. loop(8){if(currentani==ani){BR = [64,0,128,64]; yield;}}
  179. }
  180. }
  181.  
  182. task FireAnimation
  183. {
  184. ani++;
  185. let currentani = ani;
  186. while(currentani==ani)
  187. {
  188. bossflip = 0;
  189. loop(8){if(currentani==ani){BR = [0,192,64,128]; yield;}}
  190. loop(8){if(currentani==ani){BR = [64,192,128,128]; yield;}}
  191. loop(8){if(currentani==ani){BR = [128,192,192,128]; yield;}}
  192. loop(999){if(currentani==ani){BR = [192,192,256,128]; yield;}}
  193. }
  194. }
  195.  
  196. @DrawLoop
  197. {
  198. SetAlpha(255);
  199. if (bossflip==0){SetGraphicScale(1,1);}
  200. if (bossflip==1){SetGraphicScale(-1,1);}
  201. SetColor(255,255,255);
  202. SetGraphicAngle(0,0,0);
  203. SetTexture(KoishiSprite);
  204. SetGraphicRect(BR[0],BR[1],BR[2],BR[3]);
  205. DrawGraphic(GetX,GetY);
  206. }
  207.  
  208. @Finalize
  209. {
  210. DeleteGraphic(KoishiSprite);
  211. }
  212.  
  213. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement