Advertisement
Guest User

Untitled

a guest
May 22nd, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.88 KB | None | 0 0
  1. TouhouDanmakufu
  2. #Title[Rin Spell1]
  3. #Text[]
  4. #Player[FREE]
  5. #ScriptVersion[2]
  6.  
  7. script_enemy_main {
  8.  
  9.  
  10.  
  11.  
  12. #include_function ".\SHOT_REPLACE\shot_replace.dnh";
  13.  
  14.  
  15. let Cut = GetCurrentScriptDirectory~"cutin.png";
  16. let ImgBoss = GetCurrentScriptDirectory~"pl11_bs.png";
  17.  
  18. let f = 0;
  19. let f2 = 0;
  20.  
  21.  
  22. @Initialize {
  23. SetLife(1500);
  24. SetDamageRate(15,2);
  25. SetTimer(99);
  26. SetScore(1000000);
  27. LoadGraphic(Cut);
  28. SetEnemyMarker(true);
  29. SetMovePosition02(GetCenterX, GetClipMinY + 120, 120);
  30.  
  31. CutIn(YOUMU,"Flower Sign"\""Eternal Branches of the Azalea"\", "Cut",0,0,512,477);
  32.  
  33. LoadGraphic(ImgBoss);
  34. SetTexture(ImgBoss);
  35. SetGraphicRect(0, 0, 64, 64);
  36.  
  37. // LoadSE(shot);
  38. shotinit;
  39. MainTask;
  40. }
  41.  
  42. @MainLoop {
  43. SetCollisionA(GetX, GetY, 32);
  44. SetCollisionB(GetX, GetY, 24);
  45.  
  46.  
  47.  
  48. yield;
  49. }
  50.  
  51. @DrawLoop{
  52. SetTexture(ImgBoss);
  53. SetRenderState(ALPHA);
  54. SetAlpha(255);
  55. SetGraphicScale(1,1);
  56. SetGraphicAngle(0,0,0);
  57.  
  58. if(int(GetSpeedX())==0){
  59. if(f<10){ SetGraphicRect(0,0,64,64); }
  60. if(f>=10 && f<20){ SetGraphicRect(64,0,128,64); }
  61. if(f>=20 && f<30){ SetGraphicRect(128,0,192,64); }
  62. if(f>=30 && f<40){ SetGraphicRect(192,0,256,64); }
  63. f2=0;
  64. }
  65.  
  66. if(GetSpeedX()<0){
  67. if(f2<10){ SetGraphicRect(0,64,64,128); }
  68. if(f2>=10 && f2<20){ SetGraphicRect(64,64,128,128); }
  69. if(f2>=20 && f2<30){ SetGraphicRect(128,64,192,128); }
  70. if(f2>=30){ SetGraphicRect(192,64,256,128); }
  71. f2++;
  72. }
  73.  
  74. if(GetSpeedX()>0){
  75. if(f2<10){ SetGraphicRect(0,128,64,192); }
  76. if(f2>=10 && f2<20){ SetGraphicRect(64,128,128,192); }
  77. if(f2>=20 && f2<30){ SetGraphicRect(128,128,192,192); }
  78. if(f2>=30){ SetGraphicRect(192,128,256,192); }
  79. f2++;
  80. }
  81.  
  82. DrawGraphic(GetX,GetY);
  83.  
  84.  
  85.  
  86. f++;
  87. if(f==40){f=0;}
  88. }
  89.  
  90.  
  91. @Finalize {
  92. DeleteGraphic(ImgBoss);
  93.  
  94. }
  95.  
  96.  
  97. task MainTask{
  98. wait(120);
  99. yield;
  100. Movement;
  101. }
  102.  
  103. task Movement{
  104.  
  105. loop{
  106.  
  107.  
  108. ShotMain;
  109. wait(260);
  110. yield;
  111. }
  112. }
  113.  
  114. task Shot1(x,y,v,angle,graphic,delay){
  115. let obj = Obj_Create(OBJ_SHOT);
  116.  
  117. Obj_SetPosition(obj,x,y);
  118. Obj_SetSpeed(obj,v);
  119. Obj_SetAngle(obj,angle);
  120. ObjShot_SetGraphic(obj,graphic);
  121. ObjShot_SetDelay(obj,delay);
  122. ObjShot_SetBombResist(obj,true);
  123.  
  124.  
  125. while(!Obj_BeDeleted(obj)){
  126.  
  127. wait(2.5);
  128. loop(1){
  129.  
  130. CreateShotA(1, Obj_GetX(obj), Obj_GetY(obj), 0);
  131. SetShotDataA(1, 0, 0, angle + GetAngleToPlayer, 0.5, 0, 5, 52);
  132. SetShotDataA(1, 180, 2, angle + GetAngleToPlayer, 0, 0, 5, 55);
  133. FireShot(1);
  134.  
  135. angle += 360/16;
  136. }
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146. }
  147. }
  148.  
  149.  
  150.  
  151.  
  152. task ShotMain{
  153. let x = 0;
  154. let angle = rand_int(0,359);
  155.  
  156. while(x<8){
  157. Shot1(GetEnemyX+30*cos(angle),GetEnemyY+30*sin(angle),1,angle,236,0);
  158. angle+=45;
  159. x++;
  160. }
  161. }
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169. //Wait
  170.  
  171. function wait(let frames){
  172. loop(frames){yield;}
  173. }
  174.  
  175. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement