Guest User

Untitled

a guest
Oct 22nd, 2012
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #TouhouDanmakufu
  2. #Title [Nonspell]
  3. #Text[Sakuya thinks you're a wimp and goes EZ MODO]
  4. #Player[FREE]
  5. #ScriptVersion [2]
  6.  
  7. script_enemy_main {
  8.  
  9. let csd = GetCurrentScriptDirectory;
  10.  
  11. let sakuya = csd ~ "img/boss_sakuya.png";
  12. let cut = csd ~ "img/cutin.png";
  13. let bg = csd ~ "img/bg.png";
  14.  
  15. let shot = csd ~ "sound/tan.wav";
  16. let shin = csd ~ "sound/ring.wav";
  17.  
  18. let f = 0;
  19. let f2 = 0;
  20.  
  21. #include_function ".\SHOT_REPLACE\shot_replace.dnh"
  22.  
  23. @Initialize{
  24. shotinit;
  25. SetLife(1000);
  26. SetTimer(60);
  27. MagicCircle(false);
  28. SetMovePosition01(GetCenterX,120,5);
  29.  
  30. LoadGraphic(sakuya);
  31. LoadSE(shot);
  32. LoadSE(shin);
  33.  
  34. mainTask;
  35. }
  36.  
  37. @MainLoop{
  38. SetCollisionA(GetX,GetY,32);
  39. SetCollisionB(GetX,GetY,16);
  40. yield;
  41. }
  42.  
  43. @DrawLoop{
  44. SetTexture(sakuya);
  45. SetRenderState(ALPHA);
  46. SetAlpha(255);
  47. SetGraphicScale(1,1);
  48. SetGraphicAngle(0,0,0);
  49.  
  50. if(int(GetSpeedX())==0) {
  51. if(f<10){SetGraphicRect(49,35,77,95);}
  52. if(f>=10 && f<20){SetGraphicRect(49,163,77,223);}
  53. if(f>=20 && f<30){SetGraphicRect(49,291,77,351);}
  54. }
  55.  
  56. if(int(GetSpeedX())>0) {
  57. if(f2<10){SetGraphicRect(318,323,336,327);}
  58. if(f2>=10 && f2<20){SetGraphicRect(318,420,342,478);}
  59. if(f2>20){SetGraphicRect(318,420,342,478);}
  60. }
  61.  
  62.  
  63. if(int(GetSpeedX())<0) {
  64. if(f2<10){SetGraphicRect(300,35,326,95);}
  65. if(f2>=10 && f2<20){SetGraphicRect(300,163,326,223);}
  66. if(f2>20){SetGraphicRect(300,163,326,223);}
  67. }
  68. DrawGraphic(GetX,GetY);
  69.  
  70.  
  71. f++;
  72. f2++;
  73. if (f==30){f=0;}
  74. }
  75.  
  76. @Finalize{
  77. DeleteGraphic(sakuya);
  78. DeleteMusic(bgm);
  79. }
  80. }
  81.  
  82. task mainTask{
  83. wait(120);
  84. yield;
  85. fire;
  86. movement;
  87. }
  88.  
  89. task movement{
  90. loop{
  91. SetMovePosition01(GetCenterX-100,120,5);
  92. wait(60);
  93. SetMovePosition01(GetCenterX+100,139,5);
  94. wait(60);
  95. SetMovePosition01(GetCenterX+20,300,5);
  96. wait(60);
  97. yield;
  98. }
  99. }
  100.  
  101. task fire{
  102. let x = 0;
  103. let dir = 0;
  104.  
  105. loop{
  106. CreateShot01(GetEnemyX,GetEnemyY,2,GetAngleToPlayer,BLUE32,0);
  107. CreateShot01(GetEnemyX,GetEnemyY,2,GetAngleToPlayer-20,RED32,0);
  108. CreateShot01(GetEnemyX,GetEnemyY,2,GetAngleToPlayer+20,GREEN32,0);
  109. PlaySE(shot);
  110. wait(5);
  111.  
  112. while (x<40){
  113. CreateShotA(1,GetEnemyX,GetEnemyY,0);
  114. SetShotDataA(1,0,2,dir,0,0,2,AQUA32);
  115. SetShotDataA(1,60,2,dir,0.5,0,2,AQUA32);
  116. PlaySE(shin);
  117.  
  118. FireShot(1);
  119.  
  120. dir+=360/36;
  121. x++;
  122. }
  123. x=0;
  124. dir=0;
  125.  
  126. wait(60);
  127. yield;
  128. }
  129. }
  130.  
  131. function wait(w){
  132. loop(w){yield;}
  133. }
  134. }
Advertisement
Add Comment
Please, Sign In to add comment