Lunarethic

Untitled

Oct 23rd, 2013
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.91 KB | None | 0 0
  1. #TouhouDanmakufu
  2. #Title[test"]
  3. #Text[Cirno's Spell Card]
  4. #BGM[script\cirno\Beloved Tomboyish Daughter.mp3]
  5. #PlayLevel[Lunatic]
  6. #Player[FREE]
  7. #ScriptVersion[2]
  8.  
  9. script_enemy_main {
  10.  
  11. let CSD = GetCurrentScriptDirectory;
  12.  
  13. let boss = CSD ~ "anm.png";
  14. let cut = CSD ~ "cirnocutin.png";
  15. let bg = CSD ~ "ice.png";
  16. let lay = CSD ~ "snow.png";
  17. let slide = 0;
  18. let sfx1 = CSD ~ "sfx/ShotA.wav";
  19.  
  20. let f = 0;
  21. let f2 = 0;
  22.  
  23. @Initialize {
  24. SetLife(2000);
  25. SetTimer(60);
  26. SetScore(48000000);
  27. SetMovePosition01(GetCenterX, GetClipMinY + 120, 5);
  28. SetShotAutoDeleteClip(10000,10000,10000,10000);
  29. LoadGraphic(boss);
  30. LoadGraphic(cut);
  31. LoadGraphic(bg);
  32. LoadGraphic(lay);
  33. LoadSE(sfx1);
  34.  
  35. CutIn(YOUMU, "Test Sign"\""My Problem With Random Movement"\",cut,0,0,566,775);
  36.  
  37. mainTask;
  38.  
  39. }
  40.  
  41. @MainLoop {
  42. SetCollisionA(GetX,GetY,24);
  43. SetCollisionB(GetX,GetY,16);
  44. yield;
  45. }
  46.  
  47. @DrawLoop {
  48.  
  49. SetTexture(boss);
  50. SetRenderState(ALPHA);
  51. SetAlpha(255);
  52. SetGraphicScale(1,1);
  53. SetGraphicAngle(0,0,0);
  54.  
  55. if(int(GetSpeedX())==0){
  56. if(f<10){ SetGraphicRect(0,0,64,64); }
  57. if(f>=10 && f<20){ SetGraphicRect(64,0,128,64); }
  58. if(f>=20 && f<30){ SetGraphicRect(128,0,192,64); }
  59. if(f>=30 && f<40){ SetGraphicRect(192,0,256,64); }
  60. f2=0;
  61. }
  62.  
  63. if(GetSpeedX()>0){
  64. if(f2<5){ SetGraphicRect(0,64,64,128); }
  65. if(f2>=5 && f2<10){ SetGraphicRect(64,64,128,128); }
  66. if(f2>=10 && f2<15){ SetGraphicRect(128,64,192,128); }
  67. if(f2>=15){ SetGraphicRect(192,64,256,128); }
  68. f2++;
  69. }
  70.  
  71. if(GetSpeedX()<0){
  72. SetGraphicAngle(180,0,0);
  73. if(f2<5){ SetGraphicRect(0,64,64,128); }
  74. if(f2>=5 && f2<10){ SetGraphicRect(64,64,128,128); }
  75. if(f2>=10 && f2<15){ SetGraphicRect(128,64,192,128); }
  76. if(f2>=15){ SetGraphicRect(192,64,256,128); }
  77. f2++;
  78. }
  79.  
  80. DrawGraphic(GetX,GetY);
  81.  
  82. f++;
  83. if(f==40){f=0;}
  84.  
  85. }
  86.  
  87. @BackGround {
  88.  
  89. SetTexture(bg);
  90. SetRenderState(ALPHA);
  91. SetAlpha(255);
  92. SetGraphicRect(0,0,1600,1118);
  93. SetGraphicScale(1,1);
  94. SetGraphicAngle(0,0,0);
  95. DrawGraphic(GetCenterX,GetCenterY);
  96.  
  97. SetTexture(lay);
  98. SetRenderState(ADD);
  99. SetGraphicRect(0,0,20000,20000);
  100. SetGraphicScale(1,1);
  101. SetGraphicAngle(0,0,0);
  102. DrawGraphic(GetCenterX+slide,GetCenterY+slide);
  103.  
  104. slide+=2;
  105.  
  106. }
  107.  
  108. @Finalize {
  109. DeleteGraphic(boss);
  110. DeleteGraphic(bg);
  111. DeleteGraphic(cut);
  112.  
  113. }
  114.  
  115.  
  116. task mainTask{
  117. wait(60);
  118. yield;
  119. fire;
  120. move;
  121. }
  122.  
  123. task move{
  124. loop{
  125. SetMovePositionRandom01(13,13,5,120,120,120,120);
  126. wait(30);
  127.  
  128. yield;
  129. }
  130. }
  131.  
  132. task fire{
  133. let x = 0;
  134. let dir = 0;
  135. wait(30);
  136. loop{
  137. PlaySE(sfx1);
  138. while(x<36){
  139. CreateShotA(1,GetEnemyX,GetEnemyY,1);
  140. SetShotDataA(1,0,1,dir,2,-0.5,8,AQUA02);
  141. FireShot(1);
  142.  
  143. dir+=360/36;
  144. x++;
  145. }
  146. x = 0;
  147. dir = 0;
  148. wait(160);
  149.  
  150.  
  151. yield;
  152.  
  153.  
  154. }
  155. }
  156.  
  157. //Wait Function
  158. function wait(w){
  159. loop(w) {yield;}
  160. }
  161.  
  162.  
  163.  
  164. }
Advertisement
Add Comment
Please, Sign In to add comment