Advertisement
Lavalake

Hika Problem

Dec 20th, 2012
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.75 KB | None | 0 0
  1. #TouhouDanmakufu
  2. #Title[Hika Spell - easy]
  3. #Text[Hika]
  4. #PlayLevel[Easy]
  5. #Player[FREE]
  6.  
  7. script_enemy_main{
  8. LoadUserShotData("lib/ZUN/ZUN's shotdata.txt");
  9.  
  10. let CSD = GetCurrentScriptDirectory;
  11. let Hika = CSD ~ "System\Hika_Saiha.png";
  12. let Shot0 = GetCurrentScriptDirectory ~ "SE\Shot00.wav";
  13. let Shot1 = GetCurrentScriptDirectory ~ "SE\Shot01.wav";
  14. let Shot2 = GetCurrentScriptDirectory ~ "SE\Shot02.wav";
  15. let BG = CSD ~ "System\Spell.png";
  16.  
  17. @Initialize {
  18. SetLife(250);
  19. SetDamageRate(10, 10);
  20. SetTimer(60);
  21. SetScore(10000);
  22. SetEnemyMarker(true);
  23. SetInvincibility(60);
  24. SetMovePosition03(GetCenterX,120,2,3);
  25. mainTask;
  26. LoadGraphic(Hika);
  27. LoadGraphic(BG);
  28. CutIn(YOUMU, "Fire Sign "\""Flame Drop"\", Hika, 30, 0, 59, 39);
  29. }
  30.  
  31. @MainLoop {
  32. SetCollisionA(GetX,GetY,15);
  33. SetCollisionB(GetX,GetY,15);
  34. yield;
  35. }
  36.  
  37. @DrawLoop {
  38. SetTexture(Hika);
  39. SetRenderState(ALPHA);
  40. SetAlpha(225);
  41. SetGraphicScale(1,1);
  42. SetGraphicAngle(0,0,0);
  43.  
  44. if(int(GetSpeedX())==0) {
  45. SetGraphicRect(30,0,59,39);
  46. }
  47.  
  48. if(int(GetSpeedX())>0) {
  49. SetGraphicRect(60,0,89,39);
  50. }
  51.  
  52. if(int(GetSpeedX())<0) {
  53. SetGraphicRect(0,0,29,39);
  54. }
  55.  
  56. DrawGraphic(GetX,GetY);
  57. }
  58.  
  59. @BackGround {
  60. SetTexture(BG);
  61. SetRenderState(ADD);
  62. SetGraphicRect(0,0,500,500);
  63. SetGraphicScale(1,1);
  64. SetGraphicAngle(0,0,0);
  65. DrawGraphic(GetCenterX,GetCenterY);
  66.  
  67. }
  68.  
  69. @Finalize {
  70. DeleteGraphic(Hika);
  71. DeleteSE(Shot0);
  72. DeleteSE(Shot1);
  73. DeleteSE(Shot2);
  74. DeleteGraphic(BG);
  75. }
  76.  
  77. task mainTask {
  78. wait(60);
  79. yield;
  80. fire;
  81. }
  82.  
  83. task fire {
  84. let dir = 0;
  85. loop {
  86. SetMovePosition03(GetClipMinX+100,360,2,4);
  87. wait(20);
  88. loop(8) {
  89. PlaySE(Shot0);
  90. Bullet(GetEnemyX,GetEnemyY,dir,3,83,30);
  91. dir+=360/8;
  92. }
  93. SetMovePosition03(GetClipMaxX-100,245,2,4);
  94. wait(20);
  95. loop(8) {
  96. PlaySE(Shot0);
  97. Bullet(GetEnemyX,GetEnemyY,dir,3,83,30);
  98. dir+=360/8;
  99. }
  100. SetMovePosition03(GetClipMinX-100,130,2,4);
  101. wait(20);
  102. loop(8) {
  103. PlaySE(Shot0);
  104. Bullet(GetEnemyX,GetEnemyY,dir,3,83,30);
  105. dir+=360/8;
  106. }
  107. SetMovePosition03(GetCenterX,120,2,4);
  108. wait(20);
  109. loop(9) {
  110. loop(8) {
  111. PlaySE(Shot0);
  112. Bullet(GetEnemyX,GetEnemyY,dir,3,83,30);
  113. dir+=360/8;
  114. }
  115. dir++;
  116. dir++;
  117. dir++;
  118. dir++;
  119. dir++;
  120. wait(5);
  121. }
  122. wait(60);
  123. }
  124. }
  125.  
  126. task Bullet(x, y, angle, s, g, d) {
  127. let obj=Obj_Create(OBJ_SHOT);
  128.  
  129. Obj_SetPosition(obj, x, y);
  130. Obj_SetAngle(obj, angle);
  131. Obj_SetSpeed(obj, s);
  132. ObjShot_SetGraphic(obj, g);
  133. ObjShot_SetDelay (obj, d);
  134. ObjShot_SetBombResist (obj, true);
  135. }
  136.  
  137. // wait function
  138. function wait(w){
  139. loop(w){ yield; }
  140. }
  141.  
  142.  
  143. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement