SilentSorrow

Yuyuko Encounter 1

Dec 17th, 2013
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.69 KB | None | 0 0
  1. #TouhouDanmakufu
  2. #Title[Yuyuko Encounter 1]
  3. #Text[]
  4. #Player[FREE]
  5. #ScriptVersion[2]
  6.  
  7. script_enemy_main{
  8.  
  9. let CSD = GetCurrentScriptDirectory;
  10. let yuyutex = CSD ~ "IMG\yuyuSprite.png";
  11. let bg = CSD ~ "IMG\stg6_bg.png";
  12. let shots = CSD ~ "System\mainShot.txt";
  13.  
  14. let f = 0;
  15. let f2 = 0;
  16. let float = 0;
  17. let rotation = 0;
  18. let scale = 1;
  19.  
  20.  
  21. @Initialize{
  22. LoadGraphic(yuyutex);
  23. LoadUserShotData(shots);
  24. SetLife(4000);
  25. SetTimer(60);
  26. SetDamageRate(80,65);
  27. SetMovePosition01(GetCenterX,GetCenterY-100,3);
  28. SetInvincibility(120);
  29. mainTask;
  30. }
  31.  
  32.  
  33. @MainLoop{
  34. SetCollisionA(GetX,GetY,20);
  35. SetCollisionB(GetX,GetY,15);
  36. yield;
  37. }
  38.  
  39.  
  40. @DrawLoop{
  41. SetTexture(yuyutex);
  42. SetRenderState(ALPHA);
  43. SetAlpha(255);
  44. SetGraphicScale(1,1);
  45. SetGraphicAngle(0,0,0);
  46.  
  47. if(int(GetSpeedX()) == 0){
  48. SetGraphicAngle(0,0,0);
  49. if(f<10){ SetGraphicRect(0,0,48,78); }
  50. if(f>=10 && f<20){ SetGraphicRect(48,0,96,78); }
  51. if(f>=20 && f<30){ SetGraphicRect(96,0,144,78); }
  52. if(f>=30 && f<40){ SetGraphicRect(144,0,192,78); }
  53. f2 = 0;
  54. }
  55.  
  56. if(GetSpeedX() > 0){
  57. if(f2<5){ SetGraphicRect(0,78,48,156); }
  58. if(f2>=5 && f2<10){ SetGraphicRect(48,78,96,156); }
  59. if(f2>=10){ SetGraphicRect(96,78,144,156); }
  60. f2++;
  61. }
  62.  
  63. if(GetSpeedX() < 0){
  64. SetGraphicAngle(180,0,0);
  65. if(f2<5){ SetGraphicRect(0,156,48,234); }
  66. if(f2>=5 && f2<10){ SetGraphicRect(48,156,96,234); }
  67. if(f2>=10 && f2<15){ SetGraphicRect(96,156,144,234); }
  68. if(f2>=20){ SetGraphicRect(144,156,192,234); }
  69. f2++;
  70. }
  71.  
  72. DrawGraphic(GetX,GetY+5*sin(float));
  73.  
  74. float+=3;
  75. f++;
  76. if(f==40){
  77. f = 0;
  78. }
  79.  
  80. }
  81.  
  82.  
  83. @BackGround{
  84. }
  85.  
  86.  
  87. @Finalize{
  88. DeleteGraphic(yuyutex);
  89. }
  90.  
  91. task mainTask{
  92. wait(80);
  93. movement;
  94. yellowSpiral;
  95. wait(120);
  96. spiralFire;
  97. yield;
  98. }
  99.  
  100.  
  101. task movement{
  102. loop{
  103. SetMovePositionRandom01(30,10,1,GetClipMinX+75,GetClipMinY+40,GetClipMaxX-75,GetClipMaxY-225);
  104. wait(180);
  105. yield;
  106. }
  107. }
  108.  
  109.  
  110. task yellowSpiral{
  111. let r = 30;
  112. let x = 0;
  113. let dir = 0;
  114. let dir2 = 180;
  115. let dirvel = 0.3;
  116. let spiralCount = 720;
  117. let count = spiralCount/10;
  118.  
  119. loop{
  120. while(x < count){
  121. PlaySE(CSD ~ "SFX\shotb.wav");
  122. CreateShotA(1,GetEnemyX+r*cos(dir),GetEnemyY+r*sin(dir),0);
  123. SetShotDataA(1,0,2,dir,dirvel*-1,0,1,207);
  124. wait(1);
  125. FireShot(1);
  126.  
  127. CreateShotA(2,GetEnemyX+r*cos(dir2),GetEnemyY+r*sin(dir2),0);
  128. SetShotDataA(2,0,2,dir2,dirvel,0,1,207);
  129. wait(1);
  130. FireShot(2);
  131.  
  132. dir+=spiralCount/count;
  133. x++;
  134.  
  135. dir2+=spiralCount/count;
  136. x++;
  137. }
  138. //reset x
  139. x = 0;
  140. wait(90);
  141. yield;
  142. }
  143. }
  144.  
  145.  
  146. task spiralFire{
  147. let x = 0;
  148. let x2 = 0;
  149. let rad1 = 50;
  150. let rad2 = 50;
  151. let spiralCounts = 16;
  152. let delaying = 10;
  153.  
  154. loop{
  155. loop(spiralCounts){
  156. PlaySE(CSD ~ "SFX\shota.wav");
  157. ascent(i in 0..4){
  158. CreateShot01(GetX+rad1*cos(360/4*i+x),GetY+rad1*sin(360/4*i+x),2,360/4*i+x,211,delaying);
  159. //CreateShot01(GetX+rad1*cos(360/4*i+x),GetY+rad1*sin(360/4*i+x),2,360/4*i+x,237,delaying);
  160. }
  161.  
  162. x-=11;
  163. rad1-=2;
  164. if(rad1 <= -50){
  165. rad1 = 50;
  166. }
  167. wait(4);
  168. }
  169.  
  170. //butterfly burst
  171. wait(120);
  172. loop(spiralCounts){
  173. PlaySE(CSD ~ "SFX\shota.wav");
  174. ascent(z in 0..4){
  175. CreateShot01(GetX+rad2*cos(360/4*z+x2),GetY+rad2*sin(360/4*z+x2),2,360/4*z+x2,211,delaying);
  176. //CreateShot01(GetX+rad2*cos(360/4*z+x2),GetY+rad2*sin(360/4*z+x2),2,360/4*z+x2,237,delaying);
  177. }
  178. x2+=11;
  179. rad2-=2;
  180. if(rad1 <= -50){
  181. rad1 = 50;
  182. }
  183. wait(4);
  184. }
  185.  
  186. x = 0;
  187. x2 = 0;
  188. rad1 = 50;
  189. rad2 = 50;
  190. wait(60);
  191. }
  192. }
  193.  
  194.  
  195. function wait(w){
  196. loop(w){
  197. yield;
  198. }
  199. }
  200. }
Advertisement
Add Comment
Please, Sign In to add comment