BananaCupcake

Untitled

May 17th, 2019
101
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #TouhouDanmakufu[Single]
  2. #ScriptVersion[3]
  3. #Title["N1"]
  4. #Text["???"]
  5.  
  6. let objBoss;
  7. let way = 1;
  8. let stgy=GetStgFrameHeight()/2;
  9. let idle = true;
  10. let atk = false;
  11.  
  12. @Event{
  13. alternative(GetEventType())
  14. case(EV_REQUEST_LIFE){
  15. SetScriptResult(2000);
  16. }
  17. case(EV_REQUEST_TIMER){
  18. SetScriptResult(99);
  19. }
  20. case(EV_REQUEST_SPELL_SCORE){
  21. SetScriptResult(1000000);
  22. }
  23. }
  24.  
  25. @Initialize{
  26. objBoss = ObjEnemy_Create(OBJ_ENEMY_BOSS);
  27. ObjEnemy_Regist(objBoss);
  28.  
  29. ObjPrim_SetTexture(objBoss, imgBoss);
  30. ObjSprite2D_SetSourceRect(objBoss, 0, 0, 148, 125);
  31. ObjSprite2D_SetDestCenter(objBoss);
  32. ObjMove_SetDestAtFrame(objBoss, GetCenterX(), 60, 60);
  33.  
  34.  
  35.  
  36. StartPhase;
  37. wait(50);
  38. MainPhase;
  39. MainSplit;
  40. yield;
  41. TFinalize;
  42. }
  43.  
  44. @MainLoop{
  45. ObjEnemy_SetIntersectionCircleToShot(objBoss, ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 32);
  46. ObjEnemy_SetIntersectionCircleToPlayer(objBoss, ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 24);
  47. yield;
  48. }
  49.  
  50. task StartPhase{
  51. wait(120);
  52. MainTask;
  53. }
  54.  
  55. task MainPhase{
  56. loop{
  57. wait(50);
  58. SpawnBubble(0);
  59. wait(200);
  60. SpawnBubble2(0);
  61. wait(150);
  62. yield;
  63. }
  64. }
  65.  
  66. task MainSplit{
  67. ShootSplit(30);
  68. wait(200);
  69.  
  70. }
  71.  
  72. task movement{
  73. while(ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0){
  74. ObjMove_SetDestAtFrame(objBoss, rand(GetCenterX() + 90, GetCenterX() - 90), rand(GetCenterY() - 60, GetCenterY() - 120), 60);
  75. wait(20);
  76. }
  77. }
  78.  
  79. task MainTask{
  80. let angleT = GetAngleToPlayer(objBoss);
  81. loop(30){
  82. CreateShotA1(ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 5, angleT, 360, 5);
  83. ascent(i in 0..50){
  84. CreateShotA1(ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), i/50+rand(2,4), rand(i/10+angleT,angleT), 318, 5);
  85. }
  86. angleT += 360/30;
  87. }
  88. }
  89.  
  90. task SpawnBubble(angle){
  91. wait(200);
  92. loop(8){
  93. let obj = CreateShotA1(ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 2.8, angle, 360, 5);
  94. angle += 360/8;
  95. Twist(obj,0.5);
  96. SpawnBullets(obj);
  97. }
  98. }
  99.  
  100. task SpawnBubble2(angle){
  101. wait(200);
  102. loop(8){
  103. let obj = CreateShotA1(ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 4, angle, 360, 5);
  104. angle -= 360/8;
  105. Twist(obj,-1);
  106. SpawnBullets(obj);
  107. }
  108. }
  109.  
  110. task Twist(obj,velo){
  111. ObjMove_SetAngularVelocity(obj,velo);
  112.  
  113. }
  114.  
  115. task SpawnBullets(obj){
  116. loop(30){
  117. wait(5);
  118. let b = CreateShotA1(ObjMove_GetX(obj), ObjMove_GetY(obj), 0, obj, 318 , 7);
  119. Release(b);
  120. yield;
  121. }
  122. }
  123.  
  124. task Release(b){
  125. wait(100);
  126. ObjMove_SetSpeed(b,2);
  127. ObjMove_SetAngle(b,rand(0,360));
  128.  
  129. }
  130.  
  131. task ShootSplit(value){
  132. while(ObjEnemy_GetInfo(objBoss,INFO_LIFE) > 0){
  133. ObjMove_SetDestAtFrame(objBoss, GetCenterX(), 60, 60);
  134. wait(100);
  135. let angleT = 30; //Base angle faces directly right
  136. loop(10){
  137. ascent(i in 0..1){
  138. loop(10){
  139. wait(3);
  140.  
  141. let obj = CreateShotA1(ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), rand(1,2),i/20+angleT, 294, 10);
  142. angleT += 360/value;
  143. }
  144. }
  145. }
  146.  
  147. }
  148. }
  149.  
  150. function GetCenterX(){
  151. return GetStgFrameWidth() / 2;
  152. }
  153.  
  154. function GetCenterY(){
  155. return GetStgFrameHeight() / 2;
  156. }
  157.  
  158. function wait(n){
  159. loop(n){yield;}
  160. }
  161.  
  162. task TFinalize {
  163. while(ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0){yield;}
  164. Obj_Delete(objBoss);
  165. DeleteShotAll(TYPE_ALL, TYPE_IMMEDIATE);
  166. SetAutoDeleteObject(true);
  167. CloseScript(GetOwnScriptID());
  168. return;
  169. }
RAW Paste Data