Advertisement
Guest User

test

a guest
Aug 15th, 2020
787
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.24 KB | None | 0 0
  1. #TouhouDanmakufu[Single]
  2. #ScriptVersion[3]
  3. #Title["Rumia's Wall crush"]
  4. #Text["WIP"]
  5. #include "script/default_system/Default_ShotConst.txt"
  6. let objBoss;
  7. let count = 0;
  8. @Event{
  9. alternative(GetEventType())
  10. case(EV_REQUEST_LIFE){
  11. SetScriptResult(2000);
  12. }
  13. case(EV_REQUEST_TIMER){
  14. SetScriptResult(60);
  15. }
  16. case(EV_REQUEST_SPELL_SCORE){
  17. SetScriptResult(1000000);
  18. }
  19. }
  20. @Initialize{
  21. objBoss = ObjEnemy_Create(OBJ_ENEMY_BOSS);
  22. ObjEnemy_Regist(objBoss);
  23. let imgExRumia = GetCurrentScriptDirectory() ~ "ExRumia.png";
  24. ObjPrim_SetTexture(objBoss, imgExRumia);
  25. ObjSprite2D_SetSourceRect(objBoss, 64, 1, 127, 64);
  26. ObjSprite2D_SetDestCenter(objBoss);
  27. ObjMove_SetDestAtFrame(objBoss, GetCenterX(), 60, 60);
  28. TFinalize;
  29. Laser;
  30. }
  31. @MainLoop{
  32. ObjEnemy_SetIntersectionCircleToShot(objBoss, ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 32);
  33. ObjEnemy_SetIntersectionCircleToPlayer(objBoss, ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 24);
  34. if(count % 30 == 0){
  35. fire;
  36. }
  37. count++;
  38. yield;
  39. }
  40. task fire{
  41. if(ObjEnemy_GetInfo(objBoss, INFO_LIFE) <= 0){return;} //Default kill to prevent (0,0) spawning
  42. let angleT = GetAngleToPlayer(objBoss);
  43. CreateStraightLaserA1(ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), GetAngleToPlayer(objBoss), 512, 20, 60, 1002, 60);
  44. CreateShotA1(380, 90, 2, 180, DS_BALL_S_RED, 50);
  45. CreateShotA1(380, 110, 2, 180, DS_BALL_S_RED, 50);
  46. CreateShotA1(380, 130, 2, 180, DS_BALL_S_RED, 50);
  47. CreateShotA1(380, 150, 2, 180, DS_BALL_S_RED, 50);
  48. CreateShotA1(380, 170, 2, 180, DS_BALL_S_RED, 50);
  49. CreateShotA1(380, 190, 2, 180, DS_BALL_S_RED, 50);
  50. CreateShotA1(380, 210, 2, 180, DS_BALL_S_RED, 50);
  51. CreateShotA1(380, 230, 2, 180, DS_BALL_S_RED, 50);
  52. CreateShotA1(380, 250, 2, 180, DS_BALL_S_RED, 50);
  53. CreateShotA1(0, 80, -2, -180, DS_BALL_S_RED, 50);
  54. CreateShotA1(0, 100, -2, -180, DS_BALL_S_RED, 50);
  55. CreateShotA1(0, 120, -2, -180, DS_BALL_S_RED, 50);
  56. CreateShotA1(0, 140, -2, -180, DS_BALL_S_RED, 50);
  57. CreateShotA1(0, 160, -2, -180, DS_BALL_S_RED, 50);
  58. CreateShotA1(0, 180, -2, -180, DS_BALL_S_RED, 50);
  59. CreateShotA1(0, 200, -2, -180, DS_BALL_S_RED, 50);
  60. CreateShotA1(0, 220, -2, -180, DS_BALL_S_RED, 50);
  61. CreateShotA1(0, 240, -2, -180, DS_BALL_S_RED, 50);
  62. }
  63. task TFinalize {
  64. while(ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0){yield;}
  65. Obj_Delete(objBoss);
  66. DeleteShotAll(TYPE_ALL, TYPE_IMMEDIATE);
  67. SetAutoDeleteObject(true);
  68. CloseScript(GetOwnScriptID());
  69. return;
  70. }
  71. task Laser {
  72. let angleT = 0; //Base angle faces directly right
  73. loop(6){ //A ring of 6 lasers
  74. let obj = CreateStraightLaserA1(ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), angleT, 512, 24, 20, 1003, 60);
  75. ObjStLaser_SetSource(obj, false); //Do not show the laser source
  76. ObjLaser_SetGrazeInvalidFrame(obj, 5); //Allows for up to 1 graze each 5 frames
  77. ObjLaser_SetInvalidLength(obj, 5, 5); //5 percent of each end of the laser is safe
  78. angleT += 360/6; //Increments by 60 degrees clockwise each time the block is run
  79. }
  80. }
  81. function GetCenterX(){
  82. return GetStgFrameWidth() / 2;
  83. }
  84. function GetCenterY(){
  85. return GetStgFrameHeight() / 2;
  86. }
  87. function wait(n){
  88. loop(n){yield;}
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement