Advertisement
Guest User

First danmakufu script - Remilia's last spell [updated]

a guest
Jul 28th, 2015
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.38 KB | None | 0 0
  1. #BGM ["./bgm/EoSD Remilias Theme- Septette for the Dead Princess (Re-Extended).mp3"]
  2. #include "script/default_system/Default_ShotConst.txt"
  3. #include "./Cutin.txt"
  4. #include "./ExplosionEffect.txt"
  5.  
  6. let objBoss;
  7. let objScene = GetEnemyBossSceneObjectID();
  8. let objBullet;
  9. let objPlasma;
  10. let shot_sound = GetCurrentScriptDirectory ~ "se_charm.wav";
  11. let spell_sound = GetCurrentScriptDirectory ~ "se_UseSpell.wav";
  12. let explosion = GetCurrentScriptDirectory ~ "se_explosion.wav"
  13.  
  14. //Default dimension of Danmakufu's playing field is 384 * 448 pixels.
  15.  
  16. @Event
  17. {
  18. alternative(GetEventType())
  19. case(EV_REQUEST_LIFE){
  20. SetScriptResult(10000);
  21. }
  22. case(EV_REQUEST_TIMER){
  23. SetScriptResult(120);
  24. }
  25. case(EV_REQUEST_SPELL_SCORE){
  26. SetScriptResult(6000000);
  27. }
  28. }
  29.  
  30. @Initialize
  31. {
  32. objBoss = ObjEnemy_Create(OBJ_ENEMY_BOSS);
  33. ObjEnemy_Regist(objBoss);
  34. let imgRemilia = GetCurrentScriptDirectory ~ "Remilia.png";
  35. ObjPrim_SetTexture(objBoss, imgRemilia);
  36. ObjSprite2D_SetSourceRect(objBoss, 75, 0, 138, 80);
  37. ObjSprite2D_SetDestCenter(objBoss);
  38. ObjMove_SetDestAtFrame(objBoss, 90, 60, 60);
  39. StartSpell;
  40.  
  41. LoadSound(shot_sound);
  42. LoadSound(spell_sound);
  43. LoadSound(explosion);
  44.  
  45. ObjEnemyBossScene_StartSpell(objScene);
  46.  
  47. TDrawLoop;
  48. TFinalize;
  49. MainTask;
  50. }
  51.  
  52. task TDrawLoop
  53. {
  54. let imgRemilia = GetCurrentScriptDirectory ~ "Remilia.png";
  55. ObjPrim_SetTexture(objBoss, imgRemilia);
  56. ObjSprite2D_SetSourceRect(objBoss, 75, 0, 138, 80);
  57. ObjSprite2D_SetDestCenter(objBoss);
  58. }
  59.  
  60. task MainTask
  61. {
  62. Movement;
  63. PlaySE(spell_sound);
  64. wait(120);
  65. while(ObjEnemy_GetInfo(objBoss,INFO_LIFE)>0)
  66. {
  67. let angleT = 0;
  68. let angleX = 0;
  69. let objcount = 0;
  70. let objregard = 0;
  71. loop
  72. {
  73. loop(6)
  74. {
  75. objPlasma = CreateShotA1(ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 3, angleT, DS_BALL_L_PURPLE, 30);
  76. objBullet = CreateShotA1(ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 3, angleX, DS_BALL_L_RED, 30);
  77. PlaySE(shot_sound);
  78. angleT+=360/6;
  79. angleX+=360/6;
  80. BulletChange;
  81. }
  82. angleT+=objcount;
  83. angleX+=objregard;
  84. objcount+=1;
  85. objregard-=1;
  86. wait(25);
  87. }
  88. }
  89. }
  90.  
  91. task Movement
  92. {
  93. while(ObjEnemy_GetInfo(objBoss,INFO_LIFE)>0)
  94. {
  95. ObjMove_SetDestAtFrame(objBoss, rand(GetCenterX+90,GetCenterX-90), rand(GetCenterY-60,GetCenterY-120), 60);
  96. wait(180);
  97. }
  98. }
  99.  
  100. task BulletChange
  101. {
  102. ObjMove_SetAngularVelocity(objBullet, 0.3);
  103. ObjMove_SetAngularVelocity(objPlasma, -0.3);
  104. wait(10);
  105. }
  106.  
  107. task StartSpell
  108. {
  109. loop(2){yield;}
  110. let sekibanki = GetCurrentScriptDirectory ~ "Remilia Cutin.png";
  111. ObjCutin_SetSpellcardS4("\"Remilia's Netherworld\"", sekibanki, MOKOU, 240, 104, 104);
  112. ObjCutin_LaunchS3(BYAKUREN, sekibanki, "Normal");
  113. }
  114.  
  115. task TFinalize
  116. {
  117. while(ObjEnemy_GetInfo(objBoss,INFO_LIFE)>0){yield;}
  118. Explosion(objBoss);
  119. loop(1)
  120. {
  121. wait(300);
  122. Obj_Delete(objBoss);
  123. DeleteShotAll(TYPE_ALL,TYPE_ITEM);
  124. SetAutoDeleteObject(true);
  125. CloseScript(GetOwnScriptID());
  126. }
  127. }
  128. @MainLoop
  129. {
  130. ObjEnemy_SetIntersectionCircleToShot(objBoss, ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 32);
  131. ObjEnemy_SetIntersectionCircleToPlayer(objBoss, ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 24);
  132. ObjEnemy_SetDamageRate(objBoss, 100, 0);
  133. yield;
  134. }
  135.  
  136. function GetCenterX
  137. {
  138. return GetStgFrameWidth/2;
  139. }
  140. function GetCenterY
  141. {
  142. return GetStgFrameHeight/2;
  143. }
  144. function wait(n)
  145. {
  146. loop(n){yield;}
  147. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement