BananaCupcake

Untitled

Jul 18th, 2017
67
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #TouhouDanmakufu[Single]
  2. #ScriptVersion[3]
  3. #Title["Improvement B1"]
  4. #Text["???"]
  5.  
  6. #include "script/default_system/Shot/ZUNShot_Const.txt"
  7.  
  8. let objBoss;
  9. let objScene=GetEnemyBossSceneObjectID();
  10.  
  11. @Event{
  12. alternative(GetEventType())
  13. case(EV_REQUEST_LIFE){
  14. SetScriptResult(2500);
  15. }
  16. case(EV_REQUEST_TIMER){
  17. SetScriptResult(60);
  18. }
  19. case(EV_REQUEST_SPELL_SCORE){
  20. SetScriptResult(1000000);
  21. }
  22. }
  23.  
  24. @Initialize{
  25. objBoss = ObjEnemy_Create(OBJ_ENEMY_BOSS);
  26. ObjEnemy_Regist(objBoss);
  27. ObjMove_SetDestAtFrame(objBoss, GetCenterX, 60, 60);
  28. ObjEnemyBossScene_StartSpell(objScene);
  29. TDrawLoop;
  30. TFinalize;
  31. MainTask;
  32. RenderBG;
  33. }
  34.  
  35. @MainLoop{
  36. ObjEnemy_SetIntersectionCircleToShot(objBoss, ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 32);
  37. ObjEnemy_SetIntersectionCircleToPlayer(objBoss, ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 24);
  38.  
  39. yield;
  40. }
  41. task MainTask{
  42. wait(120);
  43. movement;
  44. BulletFormation;
  45. }
  46.  
  47. task RenderBG{
  48. let path1 = GetCurrentScriptDirectory() ~ "Muenzuka.png";
  49. let obj1 = ObjPrim_Create(OBJ_SPRITE_2D);
  50. ObjRender_SetBlendType(obj1, BLEND_ALPHA);
  51. Obj_SetRenderPriority(obj1, 0.21);
  52. ObjPrim_SetTexture(obj1, path1);
  53. ObjSprite2D_SetSourceRect(obj1, 0, 0, 512, 512);
  54. ObjSprite2D_SetDestRect(obj1, -256, -256, 256, 256);
  55. ObjRender_SetPosition(obj1, 384/2, 448/2, 1);
  56. let frame = 0;
  57. let alpha = 0;
  58. yield;
  59. }
  60.  
  61. task movement{
  62. while(ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0){
  63. ObjMove_SetDestAtFrame(objBoss, rand(GetCenterX + 90, GetCenterX - 90), rand(GetCenterY - 60, GetCenterY - 120), 60);
  64. wait(240);
  65. }
  66. }
  67. task BulletFormation {
  68. let angleS = angleToPlayer(Boss);
  69.  
  70. while(!Obj_IsDeleted(Boss)){
  71. ShotA1(angleS,-1,6,4,3);
  72. angleS += 11;
  73. wait(12);
  74.  
  75. }
  76.  
  77. task ShotA1(angle,offset,num1,num2,shotID){
  78. ascent(a in 0..num1){ //sets how many BULLETS are in ONE formation
  79. loop(num2){ //sets how many BULLET FORMATIONS are fired
  80. let shot1A = CreateShotA1(BossX+48*cos(angle),BossY+48*sin(angle),3-a/num1,angle,shotID,93);
  81. angle += 360/num2;
  82. }
  83. angle += offset; //determines whether the bullet formation is CURVED (offset < 0 or offset > 0) or STRAIGHT (offset == 0)
  84. }
  85. }
  86. }
  87.  
  88. task TDrawLoop {
  89. let imgBoss = GetCurrentScriptDirectory() ~ "shikieiki.png.png";
  90. ObjPrim_SetTexture(objBoss, imgBoss);
  91. ObjSprite2D_SetSourceRect(objBoss, 0, 0, 148, 125);
  92. ObjSprite2D_SetDestCenter(objBoss);
  93. }
  94. task TFinalize {
  95. while(ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0){yield;}
  96. if(ObjEnemyBossScene_GetInfo(objScene, INFO_PLAYER_SHOOTDOWN_COUNT)
  97. +ObjEnemyBossScene_GetInfo(objScene, INFO_PLAYER_SPELL_COUNT) == 0){
  98. AddScore(ObjEnemyBossScene_GetInfo(objScene, INFO_SPELL_SCORE));
  99. }
  100. Obj_Delete(objBoss);
  101. DeleteShotAll(TYPE_ALL,TYPE_IMMEDIATE);
  102. SetAutoDeleteObject(true);
  103. CloseScript(GetOwnScriptID());
  104. return;
  105. }
  106. function GetCenterX(){
  107. return GetStgFrameWidth() / 2;
  108. }
  109. function GetCenterY(){
  110. return GetStgFrameHeight() / 2;
  111. }
  112. function wait(n){
  113. loop(n){yield;}
  114. }
RAW Paste Data