Advertisement
Guest User

First Danmakufu script - Remilia's last spell

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