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 4.24 KB | None | 0 0
  1. #TouhouDanmakufu
  2. #Title[Koishi Spell ?]
  3. #Text[Survival]
  4. #PlayLevel[Extra]
  5. #Player[FREE]
  6. #ScriptVersion[2]
  7.  
  8. script_enemy_main
  9. {
  10. #include_function ".\Library.dnh"
  11. let KoishiSprite = csd~"img/KoishiSprite.png";
  12. let cutin = csd~"img/KoishiCutin.png";
  13. let blank = csd~"img/blank.png";
  14. let SpellBG01 = csd~"img/SpellBG01.png";
  15. let SpellBG02 = csd~"img/SpellBG02.png";
  16.  
  17. @Initialize
  18. {
  19. PlayMusic(csd~"Hartmann's Youkai Girl.mp3");
  20. LoadUserShotData(csd~"Shot.txt");
  21. LoadGraphic(KoishiSprite);
  22. LoadGraphic(SpellBG01);
  23. LoadGraphic(SpellBG02);
  24. SetLife(1000);
  25. SetDamageRate(0,0);
  26. SetTimer(76);
  27. SetScore(100000);
  28. SetEnemyMarker(false);
  29. SetMovePosition03(GetCenterX,GetCenterY,8,5);
  30. SetEffectForZeroLife(60,0,0);
  31. SetDurableSpellCard;
  32.  
  33. ExCutin("NAZRIN", cutin, 0, -50, 256, 512);
  34. CutIn(YOUMU,"Response "\""Responding Heart"\", blank,0,0,256,512);
  35. PlaySE(SpellCard);
  36.  
  37. MainTask;
  38. Timer;
  39. IdleAnimation;
  40. }
  41.  
  42. task MainTask
  43. {
  44. SetShotAutoDeleteClip(96,96,96,96);
  45. Wait(60);
  46.  
  47. SetColor(64,255,64);
  48. Concentration01(120);
  49. FireAnimation;
  50. SetColor(255,255,255);
  51. PlaySE(Charge1);
  52. Wait(120);
  53.  
  54.  
  55. loop
  56. {
  57. let angle = rand(0,360);
  58.  
  59. loop(1)
  60. {
  61. CreateShot02(GetPlayerX+cos(angle)*96,GetPlayerY+sin(angle)*96,0,angle+180,0.005,2,252,10);
  62. IdleFire;
  63. PlaySE(Shot2);
  64. angle += rand(15,30);
  65. Wait(2);
  66. }
  67. Wait(1);
  68. }
  69.  
  70. }
  71.  
  72. task Timer
  73. {
  74. loop
  75. {
  76. if (GetTimer > 5 && GetTimer <= 11){PlaySE(TimeOut01);}
  77. if (GetTimer >= 1 && GetTimer <= 5){PlaySE(TimeOut02);}
  78. Wait(60);
  79. }
  80. }
  81.  
  82.  
  83.  
  84. @MainLoop
  85. {
  86. yield;
  87. }
  88.  
  89. let BR = [0,0,64,64];
  90. let bossflip = 0;
  91.  
  92. let ani = 0;
  93.  
  94. task MoveAnimation
  95. {
  96. ani++;
  97. let currentani = ani;
  98.  
  99. if (GetSpeedX > 0)
  100. {
  101. bossflip = 0;
  102. loop(8){if(currentani==ani){BR = [0,64,64,128]; yield;}}
  103. loop(8){if(currentani==ani){BR = [64,64,128,128]; yield;}}
  104. loop(8){if(currentani==ani){BR = [128,64,192,128]; yield;}}
  105. while(GetSpeed>0 && currentani==ani){BR = [192,64,256,128]; yield;}
  106. loop(8){if(currentani==ani){BR = [128,64,192,128]; yield;}}
  107. loop(8){if(currentani==ani){BR = [64,64,128,128]; yield;}}
  108. }
  109. else
  110. {
  111. if (GetSpeedX < 0)
  112. {
  113. bossflip = 1;
  114. loop(8){if(currentani==ani){BR = [0,64,64,128]; yield;}}
  115. loop(8){if(currentani==ani){BR = [64,64,128,128]; yield;}}
  116. loop(8){if(currentani==ani){BR = [128,64,192,128]; yield;}}
  117. while(GetSpeed>0 && currentani==ani){BR = [192,64,256,128]; yield;}
  118. loop(8){if(currentani==ani){BR = [128,64,192,128]; yield;}}
  119. loop(8){if(currentani==ani){BR = [64,64,128,128]; yield;}}
  120. }
  121. }
  122. if(currentani==ani){IdleAnimation;}
  123. }
  124.  
  125. task IdleAnimation
  126. {
  127. ani++;
  128. let currentani = ani;
  129. while(currentani==ani)
  130. {
  131. bossflip = 0;
  132. loop(8){if(currentani==ani){BR = [0,0,64,64]; yield;}}
  133. loop(8){if(currentani==ani){BR = [64,0,128,64]; yield;}}
  134. loop(8){if(currentani==ani){BR = [128,0,192,64]; yield;}}
  135. loop(8){if(currentani==ani){BR = [192,0,256,64]; yield;}}
  136. loop(8){if(currentani==ani){BR = [128,0,192,64]; yield;}}
  137. loop(8){if(currentani==ani){BR = [64,0,128,64]; yield;}}
  138. }
  139. }
  140.  
  141. task FireAnimation
  142. {
  143. ani++;
  144. let currentani = ani;
  145. while(currentani==ani)
  146. {
  147. bossflip = 0;
  148. loop(8){if(currentani==ani){BR = [0,192,64,128]; yield;}}
  149. loop(8){if(currentani==ani){BR = [64,192,128,128]; yield;}}
  150. loop(8){if(currentani==ani){BR = [128,192,192,128]; yield;}}
  151. loop(999){if(currentani==ani){BR = [192,192,256,128]; yield;}}
  152. }
  153. }
  154.  
  155. task IdleFire
  156. {
  157. ani++;
  158. let currentani = ani;
  159. while(currentani==ani)
  160. {
  161. bossflip = 0;
  162. loop(1){if(currentani==ani){BR = [192,192,256,128]; yield;}}
  163. }
  164. }
  165.  
  166. @DrawLoop
  167. {
  168. SetAlpha(128);
  169. if (bossflip==0){SetGraphicScale(1,1);}
  170. if (bossflip==1){SetGraphicScale(-1,1);}
  171. SetColor(255,255,255);
  172. SetGraphicAngle(0,0,0);
  173. SetTexture(KoishiSprite);
  174. SetGraphicRect(BR[0],BR[1],BR[2],BR[3]);
  175. DrawGraphic(GetX,GetY);
  176. }
  177.  
  178. let bgalpha = 0;
  179. let bgangle = 0;
  180.  
  181. @BackGround
  182. {
  183. if (bgalpha < 255){bgalpha += 5;}
  184. bgangle += 0.3;
  185.  
  186. SetAlpha(bgalpha);
  187. SetGraphicScale(1,1);
  188. SetColor(255,255,255);
  189.  
  190. SetTexture(SpellBG01);
  191. SetGraphicRect(0,0,384,448);
  192. DrawGraphic(GetX,GetCenterY);
  193.  
  194. SetTexture(SpellBG02);
  195. SetGraphicRect(0,0,765,765);
  196. SetGraphicAngle(0,0,bgangle);
  197. DrawGraphic(GetCenterX,GetCenterY);
  198. }
  199.  
  200. @Finalize
  201. {
  202. DeleteGraphic(KoishiSprite);
  203. DeleteGraphic(SpellBG01);
  204. DeleteGraphic(SpellBG02);
  205. }
  206.  
  207. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement