Advertisement
Guest User

yay for codes

a guest
Feb 23rd, 2013
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.73 KB | None | 0 0
  1. #TouhouDanmakufu
  2. #Title[Spell 5]
  3. #Text[An attempt at making a spell]
  4. #Player[REIMU]
  5. #ScriptVersion[2]
  6. #PlayLevel[Normal]
  7.  
  8. script_enemy_main{
  9.  
  10. let CSD = GetCurrentScriptDirectory;
  11.  
  12. let imgBoss = CSD ~ "system\touhoucharacter1.png";
  13. let cut = CSD ~ "system\touhoucharacter3.png";
  14. let shot = CSD ~ "supershot.txt";
  15.  
  16. CutIn(YOUMU,"ugyk - i8uyg -",cut,0,0,360,290);
  17.  
  18. @Initialize{
  19. SetLife(5000);
  20. SetTimer(60);
  21. SetScore(250000);
  22. LoadGraphic(imgBoss);
  23. LoadGraphic(cut);
  24. LoadUserShotData(shot);
  25. SetMovePosition02(GetCenterX,GetCenterY,0);
  26. SetInvincibility(120);
  27. SetDamageRate(100,18);
  28. fire;
  29. fireb;
  30. firec;
  31. }
  32.  
  33. @MainLoop{
  34. SetCollisionA(GetX,GetY,32);
  35. SetCollisionB(GetX,GetY,16);
  36. yield;
  37. }
  38.  
  39. @DrawLoop{
  40. SetTexture(imgBoss);
  41. SetRenderState(ALPHA);
  42. SetAlpha(255);
  43. SetGraphicRect(0,0,110,110);
  44. SetGraphicScale(0.7,0.7);
  45. SetGraphicAngle(0,0,0);
  46. DrawGraphic(GetX,GetY);
  47. }
  48.  
  49. @BackGround{}
  50.  
  51. @Finalize{
  52. DeleteGraphic(imgBoss);
  53. DeleteGraphic(cut);
  54. }
  55. task fire{
  56. wait(60);
  57. loop{
  58. bullet(GetX,GetY,3,rand(0,359),112,0);
  59. wait(4);
  60. yield;
  61. }
  62. }
  63. task fireb{
  64. wait(60);
  65. let ang = GetCenterX;
  66. let angl = GetCenterX;
  67. loop{
  68. loop(20){CreateShot01(ang,GetClipMinY,5,90,BLUE03,0); ang+=8;}
  69. wait(30);
  70. loop(20){CreateShot01(angl,GetClipMinY,5,90,BLUE03,0); angl-=8;}
  71. wait(30);
  72. yield;
  73. }
  74. }
  75. task firec{
  76. wait(60);
  77. loop{
  78. CreateShot01(GetX,GetY,5,90,BLUE03,0);
  79. wait(30);
  80. yield;
  81. }
  82. }
  83. task bullet(x,y,v,dir,graphic,delay){
  84.  
  85. let obj=Obj_Create(OBJ_SHOT);
  86.  
  87.  
  88. Obj_SetPosition(obj,x,y);
  89.  
  90.  
  91.  
  92. Obj_SetSpeed(obj,v);
  93.  
  94.  
  95. Obj_SetAngle(obj,dir);
  96. ObjShot_SetGraphic(obj,graphic);
  97.  
  98.  
  99. ObjShot_SetDelay(obj,delay);
  100.  
  101.  
  102. ObjShot_SetBombResist(obj, true);
  103.  
  104.  
  105.  
  106. while(!Obj_BeDeleted(obj)){
  107. if(Obj_GetY(obj) > GetClipMaxY){CreateShot01(Obj_GetX(obj),Obj_GetY(obj),2,dir-90,AQUA03,0);
  108.  
  109. }
  110. if(Obj_GetX(obj) > GetClipMaxX){CreateShot01(Obj_GetX(obj),Obj_GetY(obj),2,dir-90,AQUA03,0);
  111.  
  112. }
  113. if(Obj_GetY(obj) < GetClipMinY){CreateShot01(Obj_GetX(obj),Obj_GetY(obj),2,dir-90,AQUA03,0);
  114.  
  115.  
  116.  
  117. }
  118. if(Obj_GetX(obj) < GetClipMinX){CreateShot01(Obj_GetX(obj),Obj_GetY(obj),2,dir-90,AQUA03,0);
  119.  
  120.  
  121.  
  122. }
  123. yield;}
  124. }
  125. task bulletb(x,y,v,dir,graphic,delay){
  126.  
  127. let obj=Obj_Create(OBJ_SHOT);
  128.  
  129.  
  130. Obj_SetPosition(obj,x,y);
  131.  
  132.  
  133.  
  134. Obj_SetSpeed(obj,v);
  135.  
  136.  
  137. Obj_SetAngle(obj,dir);
  138. ObjShot_SetGraphic(obj,graphic);
  139.  
  140.  
  141. ObjShot_SetDelay(obj,delay);
  142.  
  143.  
  144. ObjShot_SetBombResist(obj, true);
  145.  
  146. let count = 0;
  147. while(!Obj_BeDeleted(obj)){
  148. count++;
  149. if(count%20[<10){Obj_SetAngle(obj, Obj_GetAngle(obj)+1);}else{Obj_SetAngle(obj, Obj_GetAngle(obj)-1);}
  150. yield;}
  151. }
  152. function wait(w){loop(w){yield;}}
  153. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement