Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.02 KB | None | 0 0
  1. #TouhouDanmakufu
  2. #Title[Suwako Spellcard 1]
  3. #Text[Spell]
  4. #BackGround[User(.\img\stage.png,0,0)]
  5. #PlayLevel[Extra]
  6. #Player[FREE]
  7. #ScriptVersion[2]
  8.  
  9. script_enemy_main
  10. {
  11. #include_function ".\Library.dnh"
  12.  
  13. let SuwakoSprite = csd~"img/Suwako/SuwakoSprite.png";
  14. let cutin = csd~"img/Suwako/SuwakoCutin.png";
  15. let blank = csd~"img/blank.png";
  16. let SpellBG01 = csd~"img/Suwako/SpellBG01.png";
  17. let SpellBG02 = csd~"img/Suwako/SpellBG02.png";
  18. let angle = 0;
  19. let angle2 = 0;
  20. let wave = 0;
  21.  
  22. @Initialize
  23. {
  24. PlayMusic(csd~"Native Faith.mp3");
  25. LoadUserShotData(csd~"Shot.txt");
  26. LoadGraphic(SuwakoSprite);
  27. LoadGraphic(SpellBG01);
  28. LoadGraphic(SpellBG02);
  29. SetText("Splash Sign "\""Water Spreads, Rainbow Falls"\");
  30. SetLife(1000);
  31. SetDamageRate(0,0);
  32. SetTimer(81);
  33. SetScore(100000);
  34. SetEnemyMarker(true);
  35. SetEffectForZeroLife(60,0,0);
  36.  
  37. ExCutin("KANAKO", cutin, 0, 0, 256, 512);
  38. PlaySE(SpellCard);
  39.  
  40. MainTask;
  41. VulnerableSpell;
  42. Timer;
  43. MoveAbout;
  44.  
  45. InitAnimation;
  46. Idle;
  47. }
  48.  
  49. task MainTask
  50. {
  51. Wait(60);
  52. SetColor(255,255,0);
  53. Concentration01(120);
  54. SetColor(255,255,255);
  55. PlaySE(Charge1);
  56. Wait(120);
  57.  
  58. Cast;
  59. Wait(16);
  60. Fire;
  61. loop
  62. {
  63. CreateLaser01(GetClipMinX+16,GetClipMinY,2,90,256,16,56,10); //red
  64. CreateLaser01(GetCenterX-120,GetClipMinY,2,90,256,16,68,10); //orange
  65. CreateLaser01(GetCenterX-65,GetClipMinY,2,90,256,16,67,10); //yellow
  66. CreateLaser01(rand(204, 245),GetClipMinY,2,90,256,16,64,10); //green
  67. CreateLaser01(GetCenterX+65,GetClipMinY,2,90,256,16,62,10); //aqua
  68. CreateLaser01(GetCenterX+120,GetClipMinY,2,90,256,16,60,10); //blue
  69. CreateLaser01(GetClipMaxX-16,GetClipMinY,2,90,256,16,57,10); //violet
  70. PlaySE(Laser1);
  71. Wait(150);
  72.  
  73. Rain;
  74. Shower;
  75. Wait(1);
  76. }
  77. }
  78.  
  79. task Rain
  80. {
  81. loop(240)
  82. {
  83. CreateShot01(rand(30, 420),GetClipMinY,rand(1,2),90,187,10);
  84. PlaySE(Shot2);
  85. Wait(15);
  86. }
  87. }
  88.  
  89. task Shower
  90. {
  91. loop(60)
  92. {
  93. CreateShot02(GetX,GetY,6,GetAngleToPlayer+sin(wave)*62,-0.1,2,240,10);
  94. CreateShot02(GetX,GetY,6,GetAngleToPlayer+sin(wave)*62+90,-0.1,2,240,10);
  95. CreateShot02(GetX,GetY,6,GetAngleToPlayer+sin(wave)*62-90,-0.1,2,240,10);
  96. CreateShot02(GetX,GetY,6,GetAngleToPlayer+sin(wave)*62+180,-0.1,2,240,10);
  97. PlaySE(Shot2);
  98. wave += 6;
  99. Wait(3);
  100. }
  101. }
  102.  
  103. task MoveAbout
  104. {
  105. SetMovePosition02(GetCenterX,GetCenterY-120,30);
  106. Move;
  107. }
  108.  
  109. function InitAnimation
  110. {
  111. CreateAnimation("Boss", "Idle", 4);
  112. SetAnimationFrame("Boss","Idle",0,SuwakoSprite,8,0,0,64,64);
  113. SetAnimationFrame("Boss","Idle",1,SuwakoSprite,8,64,0,128,64);
  114. SetAnimationFrame("Boss","Idle",2,SuwakoSprite,8,128,0,192,64);
  115. SetAnimationFrame("Boss","Idle",3,SuwakoSprite,8,192,0,256,64);
  116.  
  117. CreateAnimation("Boss", "Move", 4);
  118. SetAnimationFrame("Boss","Move",0,SuwakoSprite,4,0,64,64,128);
  119. SetAnimationFrame("Boss","Move",1,SuwakoSprite,4,64,64,128,128);
  120. SetAnimationFrame("Boss","Move",2,SuwakoSprite,4,128,64,192,128);
  121. SetAnimationFrame("Boss","Move",3,SuwakoSprite,4,192,64,256,128);
  122.  
  123. CreateAnimation("Boss", "StopMove", 3);
  124. SetAnimationFrame("Boss","StopMove",0,SuwakoSprite,4,192,64,256,128);
  125. SetAnimationFrame("Boss","StopMove",1,SuwakoSprite,4,128,64,192,128);
  126. SetAnimationFrame("Boss","StopMove",2,SuwakoSprite,4,64,64,128,128);
  127.  
  128. CreateAnimation("Boss", "Cast", 4);
  129. SetAnimationFrame("Boss","Cast",0,SuwakoSprite,4,0,128,64,192);
  130. SetAnimationFrame("Boss","Cast",1,SuwakoSprite,4,64,128,128,192);
  131. SetAnimationFrame("Boss","Cast",2,SuwakoSprite,4,128,128,192,192);
  132. SetAnimationFrame("Boss","Cast",3,SuwakoSprite,4,192,128,256,192);
  133.  
  134. CreateAnimation("Boss", "Fire", 4);
  135. SetAnimationFrame("Boss","Fire",0,SuwakoSprite,4,0,192,64,256);
  136. SetAnimationFrame("Boss","Fire",1,SuwakoSprite,4,64,192,128,256);
  137. SetAnimationFrame("Boss","Fire",2,SuwakoSprite,4,128,192,192,256);
  138. SetAnimationFrame("Boss","Fire",3,SuwakoSprite,4,192,192,256,256);
  139. }
  140.  
  141. sub Idle{Animate("Boss","Idle",true);}
  142. sub Cast{xflip = 1; Animate("Boss","Cast",false);}
  143. sub Fire{Animate("Boss","Fire",true);}
  144.  
  145. task Move
  146. {
  147. if(GetSpeedX>0)
  148. {
  149. xflip = 1;
  150. Animate("Boss","Move",false);
  151. yield;
  152. while(GetSpeed>0.1)
  153. {
  154. yield;
  155. }
  156. Animate("Boss","StopMove",false);
  157. }
  158. if(GetSpeedX<0)
  159. {
  160. xflip = -1;
  161. Animate("Boss","Move",false);
  162. yield ;
  163. while(GetSpeed>0.1)
  164. {
  165. yield ;
  166. }
  167. Animate("Boss","StopMove",false);
  168. }
  169. Wait(15);
  170. Animate("Boss","Idle",true);
  171. }
  172.  
  173. @MainLoop
  174. {
  175. SetCollisionA(GetX,GetY,28);
  176. SetCollisionB(GetX,GetY,28);
  177. yield;
  178. }
  179.  
  180. @DrawLoop
  181. {
  182. SetAlpha(255);
  183. SetGraphicScale(xflip,1);
  184. SetColor(255,255,255);
  185. SetGraphicAngle(0,0,0);
  186. DrawAnimatedSprite("Boss",GetX,GetY);
  187. }
  188.  
  189. let bgalpha = 0;
  190. let bgscroll = 0;
  191.  
  192. @BackGround
  193. {
  194. if (bgalpha < 255){bgalpha += 5;}
  195. bgscroll += 1.5;
  196.  
  197. SetAlpha(bgalpha);
  198. SetGraphicScale(1,1);
  199. SetColor(255,255,255);
  200.  
  201. SetTexture(SpellBG01);
  202. SetGraphicRect(0,0,384,448);
  203. DrawGraphic(GetCenterX,GetCenterY);
  204.  
  205. SetTexture(SpellBG02);
  206. SetGraphicScale(1,1);
  207. SetGraphicRect(0,0,bgscroll+512,512);
  208. DrawGraphic(GetCenterX,GetCenterY);
  209. }
  210.  
  211. @Finalize
  212. {
  213. DeleteGraphic(SuwakoSprite);
  214. DeleteGraphic(SpellBG01);
  215. DeleteGraphic(SpellBG02);
  216. }
  217.  
  218. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement