Advertisement
Guest User

First Danmakufu script - Remilia's extra spell

a guest
Jul 26th, 2015
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.46 KB | None | 0 0
  1. TouhouDanmakufu[Single]
  2. #ScriptVersion[3]
  3. #Title ["Remilia's Second Challenge [Extra]"]
  4. #Text ["The end of the world."]
  5. #Background ["./Background.txt"]
  6. #BGM ["./bgm/UFO Nues Theme - Heian Alien.mp3"]
  7. #include "script/default_system/Default_ShotConst.txt"
  8. #include "./Cutin.txt"
  9. #include "./ExplosionEffect.txt"
  10.  
  11. let objBoss;
  12. let objScene = GetEnemyBossSceneObjectID();
  13. let objBullet;
  14. let objPlasma;
  15. let shot_sound = GetCurrentScriptDirectory ~ "se_shot.wav";
  16. let spell_sound = GetCurrentScriptDirectory ~ "se_UseSpell.wav";
  17. let explosion = GetCurrentScriptDirectory ~ "se_explosion.wav";
  18.  
  19. //Default dimension of Danmakufu's playing field is 384 * 448 pixels.
  20.  
  21. @Event
  22. {
  23. alternative(GetEventType())
  24. case(EV_REQUEST_LIFE){
  25. SetScriptResult(21000);
  26. }
  27. case(EV_REQUEST_TIMER){
  28. SetScriptResult(999);
  29. }
  30. case(EV_REQUEST_SPELL_SCORE){
  31. SetScriptResult(10000000);
  32. }
  33. }
  34.  
  35. @Initialize
  36. {
  37. objBoss = ObjEnemy_Create(OBJ_ENEMY_BOSS);
  38. ObjEnemy_Regist(objBoss);
  39. let imgRemilia = GetCurrentScriptDirectory ~ "Remilia.png";
  40. ObjPrim_SetTexture(objBoss, imgRemilia);
  41. ObjSprite2D_SetSourceRect(objBoss, 75, 0, 138, 80);
  42. ObjSprite2D_SetDestCenter(objBoss);
  43. ObjMove_SetDestAtFrame(objBoss, 90, 60, 60);
  44. StartSpell;
  45.  
  46. LoadSound(shot_sound);
  47. LoadSound(spell_sound);
  48. LoadSound(explosion);
  49.  
  50. ObjEnemyBossScene_StartSpell(objScene);
  51. SetPlayerLife(6);
  52.  
  53. TDrawLoop;
  54. TFinalize;
  55. MainTask;
  56. }
  57.  
  58. task TDrawLoop
  59. {
  60. let imgRemilia = GetCurrentScriptDirectory ~ "Remilia.png";
  61. ObjPrim_SetTexture(objBoss, imgRemilia);
  62. ObjSprite2D_SetSourceRect(objBoss, 75, 0, 138, 80);
  63. ObjSprite2D_SetDestCenter(objBoss);
  64. }
  65.  
  66. task MainTask
  67. {
  68. Movement;
  69. PlaySE(spell_sound);
  70. wait(120);
  71. while(ObjEnemy_GetInfo(objBoss,INFO_LIFE)>0)
  72. {
  73. let angleT = 0;
  74. let angleX = 0;
  75. let objcount = 0;
  76. let objregard = 0;
  77. loop
  78. {
  79. while(ObjEnemy_GetInfo(objBoss,INFO_LIFE)>14000)
  80. {
  81. loop(6)
  82. {
  83. objPlasma = CreateShotA1(ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 5, angleT, DS_BALL_M_A_BLUE, 30);
  84. objBullet = CreateShotA1(ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 2, angleX, DS_BALL_M_A_RED, 30);
  85. PlaySE(shot_sound);
  86. angleT+=360/6;
  87. angleX+=360/6;
  88. BulletChange;
  89. }
  90. angleT+=objcount;
  91. angleX+=objregard;
  92. objcount+=3;
  93. objregard-=3;
  94. wait(15);
  95. }
  96. while(ObjEnemy_GetInfo(objBoss,INFO_LIFE)>7000)
  97. {
  98. loop(8)
  99. {
  100. CreateShotA1(ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 2, angleX, DS_BALL_M_A_GREEN, 30);
  101. CreateShotA1(ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 4, angleT, DS_BALL_M_A_YELLOW, 30);
  102. PlaySE(shot_sound);
  103. angleT+=360/8;
  104. angleX+=360/8;
  105. }
  106. angleT+=objcount;
  107. angleX+=objregard;
  108. objcount+=2;
  109. objregard-=2;
  110. wait(15);
  111. }
  112. while(ObjEnemy_GetInfo(objBoss,INFO_LIFE)>0)
  113. {
  114. loop(90)
  115. {
  116. objPlasma = CreateShotA1(ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 3, angleT, DS_BALL_M_A_BLUE, 30);
  117. objBullet = CreateShotA1(ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 4, angleX, DS_BALL_M_A_PURPLE, 30);
  118. PlaySE(shot_sound);
  119. angleT+=360/10;
  120. angleX+=360/10;
  121. BulletChangeII;
  122. }
  123. angleT+=objcount;
  124. angleX+=objregard;
  125. objcount+=4;
  126. objregard-=4;
  127. wait(60);
  128. }
  129. }
  130. }
  131. }
  132.  
  133. task Movement
  134. {
  135. while(ObjEnemy_GetInfo(objBoss,INFO_LIFE)>0)
  136. {
  137. ObjMove_SetDestAtFrame(objBoss, rand(GetCenterX+90,GetCenterX-90), rand(GetCenterY-60,GetCenterY-120), 60);
  138. wait(180);
  139. }
  140. }
  141.  
  142. task BulletChange
  143. {
  144. ObjMove_SetAngularVelocity(objBullet, 0.2);
  145. ObjMove_SetAngularVelocity(objPlasma, -0.5);
  146. wait(10);
  147. }
  148.  
  149. task BulletChangeII
  150. {
  151. ObjMove_SetAngle(objBullet, rand(0,360));
  152. ObjMove_SetAngle(objPlasma, rand(0,360));
  153. wait(60);
  154. }
  155.  
  156. task StartSpell
  157. {
  158. loop(2){yield;}
  159. let sekibanki = GetCurrentScriptDirectory ~ "Remilia Cutin.png";
  160. ObjCutin_SetSpellcardS4("\"Remilia's Galaxy\"", sekibanki, MOKOU, 240, 104, 104);
  161. ObjCutin_LaunchS3(BYAKUREN, sekibanki, "Extra");
  162. }
  163.  
  164. task TFinalize
  165. {
  166. while(ObjEnemy_GetInfo(objBoss,INFO_LIFE)>0){yield;}
  167. Explosion(objBoss);
  168. }
  169.  
  170. @MainLoop
  171. {
  172. ObjEnemy_SetIntersectionCircleToShot(objBoss, ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 32);
  173. ObjEnemy_SetIntersectionCircleToPlayer(objBoss, ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 24);
  174. yield;
  175. }
  176.  
  177. function GetCenterX
  178. {
  179. return GetStgFrameWidth/2;
  180. }
  181. function GetCenterY
  182. {
  183. return GetStgFrameHeight/2;
  184. }
  185. function wait(n)
  186. {
  187. loop(n){yield;}
  188. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement