BananaCupcake

Untitled

Sep 14th, 2017
89
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #TouhouDanmakufu[Single]
  2. #ScriptVersion[3]
  3. #Title["Improvement C11"]
  4. #Text["???"]
  5.  
  6. // Example, definitely required for cut-in.
  7. let cut = GetCurrentScriptDirectory ~ "CutIn.png";
  8. let objBoss;
  9. let objScene=GetEnemyBossSceneObjectID();
  10. let size = 0.8;
  11. let type = true;
  12. let obj = 1;
  13. let bSpell = false;
  14. let x = 1;
  15. let y = 1;
  16. let ang = 0;
  17. let l = 1024;
  18. let w = 2;
  19. let dt = 60;
  20. let graph = 2;
  21. let delay = 10;
  22. let i = 0.5;
  23.  
  24. #include "script/function_cutin.txt"
  25. #include "script/default_system/Shot/ZUNShot_Const.txt"
  26.  
  27. @Initialize {
  28.  
  29. // Cutin call function! Add or remove double slashes to check them out.
  30. cutin(NAZRIN,cut,0,0,676,664);
  31. //cutin(BYAKUREN,cut,0,0,676,664);
  32. //cutin(KANAKO,cut,0,0,676,664);
  33. objBoss = ObjEnemy_Create(OBJ_ENEMY_BOSS);
  34. ObjEnemy_Regist(objBoss);
  35. ObjMove_SetDestAtFrame(objBoss, GetCenterX, 100, 100);
  36. ObjEnemyBossScene_StartSpell(objScene);
  37. TDrawLoop;
  38. TFinalize;
  39. MainTask;
  40. RenderBG;
  41. }
  42.  
  43. @Event {
  44. alternative(GetEventType())
  45. case(EV_REQUEST_LIFE){
  46. SetScriptResult(4000);
  47. }
  48. case(EV_REQUEST_TIMER){
  49. SetScriptResult(150);
  50. }
  51. case(EV_REQUEST_SPELL_SCORE){
  52. SetScriptResult(1000000);
  53. }
  54. }
  55.  
  56. @MainLoop {
  57. ObjEnemy_SetIntersectionCircleToShot(objBoss, ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 32);
  58. ObjEnemy_SetIntersectionCircleToPlayer(objBoss, ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 24);
  59. let objScene = GetEnemyBossSceneObjectID();
  60. if(objScene != ID_INVALID && ObjEnemyBossScene_GetInfo(objScene, INFO_IS_SPELL))
  61. {
  62. bSpell = true;
  63. }
  64. else
  65. {
  66. bSpell = false;
  67. }
  68. yield;
  69. }
  70.  
  71. task MainTask{
  72. wait(120);
  73.  
  74. magiccircle(objBoss,size,type);
  75. fireA;
  76.  
  77. }
  78.  
  79. task fireA{
  80. while(ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0){
  81. wait(380);
  82. let lpcnt = 0;
  83. loop(4){
  84. let laser = CreateStraightLaserA1(ObjMove_GetX(objBoss),ObjMove_GetY(objBoss),90*lpcnt,300,20,150,7,200);
  85. lasercontrol(laser);
  86. let x = ObjMove_GetX(laser);
  87. let y = ObjMove_GetY(laser);
  88. let a = ObjStLaser_GetAngle(laser);
  89. let len = ObjLaser_GetLength(laser);
  90. let num = 8;
  91. ascent(i in 0..num){
  92. let dist = i*len/num;
  93. let shot = bullet(x + cos(a)*dist, y + sin(a)*dist); // this is just the xy position
  94. }
  95.  
  96. lpcnt++;
  97. }
  98. }
  99. }
  100.  
  101. task lasercontrol(laser) {
  102. let lpcnt = 0;
  103. while(!Obj_IsDeleted(laser)){
  104. ObjStLaser_SetAngle(laser,ObjStLaser_GetAngle(laser)+0.7);
  105. lpcnt++;
  106. yield;
  107. }
  108. }
  109.  
  110. task bullet(x, y){
  111. wait(40);
  112. loop(30){
  113. let obj = CreateShotA1(ObjMove_GetX(objBoss),ObjMove_GetY(objBoss),2,ang,45,10);
  114. let obj2 = CreateShotA1(ObjMove_GetX(objBoss),ObjMove_GetY(objBoss),1.5,ang,46,10);
  115. ang += 360/30;
  116. }
  117. }
  118.  
  119. task RenderBG{
  120. let path1 = GetCurrentScriptDirectory() ~ "Muenzuka.png";
  121. let obj1 = ObjPrim_Create(OBJ_SPRITE_2D);
  122. ObjRender_SetBlendType(obj1, BLEND_ALPHA);
  123. Obj_SetRenderPriority(obj1, 0.20);
  124. ObjPrim_SetTexture(obj1, path1);
  125. ObjSprite2D_SetSourceRect(obj1, 0, 0, 512, 512);
  126. ObjSprite2D_SetDestRect(obj1, -256, -256, 256, 256);
  127. ObjRender_SetPosition(obj1, 384/2, 448/2, 1);
  128. let frame = 0;
  129. let alpha = 0;
  130. loop {
  131. if (bSpell) { //Transition from stage background
  132. alpha = 255;
  133. } else {
  134. alpha = 0; //If no longer spell
  135. }
  136. Obj_SetVisible(obj1, alpha > 0);
  137. frame++;
  138. yield;
  139. }
  140. }
  141.  
  142. task magiccircle(objBoss,size,type){
  143. let obj=ObjPrim_Create(OBJ_SPRITE_2D);
  144. let GCSD = GetCurrentScriptDirectory;
  145. let img=GCSD~"MG (3).png";
  146. let spin = 0;
  147. let s = 0;
  148. LoadTexture(img);
  149. ObjPrim_SetTexture(obj,img);
  150. ObjSprite2D_SetSourceRect(obj,0,0,256,256);
  151. ObjSprite2D_SetDestCenter(obj);
  152. ObjRender_SetScaleXYZ(obj,size,size,size);
  153. ObjRender_SetAlpha(obj,230);
  154. Obj_SetRenderPriority(obj,0.35);
  155. while(!Obj_IsDeleted(objBoss)){
  156. spin += 3;
  157. ObjRender_SetAngleXYZ(obj,0,0,-spin*1.5);
  158. ObjRender_SetPosition(obj,ObjMove_GetX(objBoss),ObjMove_GetY(objBoss),0);
  159. if(type==true){
  160. ObjRender_SetScaleXYZ(obj,size+0.08*sin(spin),size+0.08*sin(spin),0);
  161. }
  162. ObjMove_SetPosition(obj,ObjMove_GetX(objBoss), ObjMove_GetY(objBoss));
  163. yield;
  164. }
  165. Obj_Delete(obj);
  166. }
  167.  
  168. task TDrawLoop{
  169. let imgBoss = GetCurrentScriptDirectory() ~ "shikieiki.png.png";
  170. ObjPrim_SetTexture(objBoss, imgBoss);
  171. ObjSprite2D_SetSourceRect(objBoss, 0, 0, 148, 125);
  172. ObjSprite2D_SetDestCenter(objBoss);
  173. }
  174.  
  175. task TFinalize{
  176. while(ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0){yield;}
  177. if(ObjEnemyBossScene_GetInfo(objScene, INFO_PLAYER_SHOOTDOWN_COUNT)
  178. +ObjEnemyBossScene_GetInfo(objScene, INFO_PLAYER_SPELL_COUNT) == 0){
  179. AddScore(ObjEnemyBossScene_GetInfo(objScene, INFO_SPELL_SCORE));
  180. }
  181. Obj_Delete(objBoss);
  182. DeleteShotAll(TYPE_ALL,TYPE_IMMEDIATE);
  183. SetAutoDeleteObject(false);
  184. CloseScript(GetOwnScriptID());
  185. return;
  186. }
  187.  
  188.  
  189.  
  190. function wait(n){
  191. loop(n){yield;}
  192. }
RAW Paste Data