BananaCupcake

Untitled

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