Guest User

EternalLight

a guest
May 10th, 2018
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.80 KB | None | 0 0
  1. #TouhouDanmakufu[Single]
  2. #ScriptVersion[3]
  3. #Title["Fluidmovement"]
  4. #Text["New"]
  5. #include "script/default_system/Default_ShotConst.txt"
  6.  
  7. let objBoss;
  8. let objScene = GetEnemyBossSceneObjectID();
  9. let count = 0;
  10.  
  11. @Event{
  12. alternative(GetEventType())
  13. case(EV_REQUEST_LIFE){
  14. SetScriptResult(500);
  15. }
  16. case(EV_REQUEST_TIMER){
  17. SetScriptResult(60);
  18. }
  19. case(EV_REQUEST_SPELL_SCORE){
  20. SetScriptResult(1000000);
  21. }
  22. }
  23. @Initialize{
  24. objBoss = ObjEnemy_Create(OBJ_ENEMY_BOSS);
  25. ObjEnemy_Regist(objBoss);
  26. ObjMove_SetDestAtFrame(objBoss, GetCenterX(), 60, 60);
  27.  
  28. ObjEnemyBossScene_StartSpell(objScene);
  29.  
  30.  
  31. TDrawLoop;
  32. TFinalize;
  33.  
  34. }
  35. task TDrawLoop {
  36. let imgExRumia = GetCurrentScriptDirectory() ~ "ExRumia.png";
  37. ObjPrim_SetTexture(objBoss, imgExRumia);
  38. ObjSprite2D_SetSourceRect(objBoss, 64, 1, 127, 64);
  39. ObjSprite2D_SetDestCenter(objBoss);
  40.  
  41. }
  42. @MainLoop{
  43. ObjEnemy_SetIntersectionCircleToShot(objBoss, ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 32);
  44. ObjEnemy_SetIntersectionCircleToPlayer(objBoss, ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 24);
  45. if(count == 0){movement;}
  46. if(count % 30 == 0 && count >= 0){
  47. fireRing;
  48. }
  49. if(count % 360 == 90 && count >= 0){
  50. fireLaser(1);
  51. fireLaser(-1);
  52. }
  53. count++;
  54. yield;
  55. }
  56.  
  57.  
  58. task fireRing{
  59. let angleT = GetAngleToPlayer(objBoss);
  60. loop(48){
  61. CreateShotA1(ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 3, angleT, DS_BALL_SS_BLUE, 10);
  62. angleT += 360/48;
  63. }
  64. }
  65. task fireLaser(dir){
  66. let obj = CreateStraightLaserA1(ObjMove_GetX(objBoss), ObjMove_GetY(objBoss),
  67. 270 + 105*dir, 512, 36, 120, DS_BEAM_BLUE, 30);
  68. ascent(i in 0..120){
  69. ObjStLaser_SetAngle(obj, 270 + 105*dir + 60/120*i * dir);
  70. yield;
  71. }
  72. }
  73. task movement{
  74. while(ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0){
  75. ObjMove_SetDestAtFrame(objBoss, rand(GetCenterX + 90, GetCenterX - 90), rand(GetCenterY - 90, GetCenterY - 150), 60);
  76. wait(360);
  77. }
  78. }
  79. task TFinalize {
  80. while(ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0){yield;}
  81. Obj_Delete(objBoss);
  82. DeleteShotAll(TYPE_ALL, TYPE_IMMEDIATE);
  83. SetAutoDeleteObject(true);
  84. CloseScript(GetOwnScriptID());
  85. return;
  86. if(ObjEnemyBossScene_GetInfo(objScene, INFO_PLAYER_SHOOTDOWN_COUNT)
  87. +ObjEnemyBossScene_GetInfo(objScene, INFO_PLAYER_SPELL_COUNT) == 0){
  88. AddScore(ObjEnemyBossScene_GetInfo(objScene, INFO_SPELL_SCORE));
  89. }
  90. }
  91.  
  92.  
  93. function GetCenterX(){
  94. return GetStgFrameWidth() / 2;
  95. }
  96. function GetCenterY(){
  97. return GetStgFrameHeight() / 2;
  98. }
  99. function wait(n){
  100. loop(n){yield;}
  101. }
Advertisement
Add Comment
Please, Sign In to add comment