BananaCupcake

Untitled

Aug 31st, 2017
83
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #TouhouDanmakufu[Single]
  2. #ScriptVersion[3]
  3. #Title["Test Cutin"]
  4. #Text["???"]
  5.  
  6. #include "script/default_system/Shot/ZUNShot_Const.txt"
  7. #include "script\function_cutin.txt"
  8.  
  9.  
  10. let objBoss;
  11. let objScene=GetEnemyBossSceneObjectID();
  12. let size = 1.5;
  13. let type = true;
  14. let GCSD = GetCurrentScriptDirectory;
  15. let cut = GetCurrentScriptDirectory ~ "CutIn.png";
  16.  
  17. InstallFont(GetCurrentScriptDirectory() ~ "font/Revue.ttf");
  18.  
  19. @Event{
  20. alternative(GetEventType())
  21. case(EV_REQUEST_LIFE){
  22. SetScriptResult(2500);
  23. }
  24. case(EV_REQUEST_TIMER){
  25. SetScriptResult(150);
  26. }
  27. case(EV_REQUEST_SPELL_SCORE){
  28. SetScriptResult(1000000);
  29. }
  30. }
  31.  
  32. @Initialize{
  33. // Cutin call function! Add or remove double slashes to check them out.
  34. cutin("BYAKUREN",cut,0,0,676,664);
  35. objBoss = ObjEnemy_Create(OBJ_ENEMY_BOSS);
  36. ObjEnemy_Regist(objBoss);
  37. ObjMove_SetDestAtFrame(objBoss, GetCenterX, 60, 60);
  38. ObjEnemyBossScene_StartSpell(objScene);
  39. TDrawLoop;
  40. TFinalize;
  41. MainTask;
  42. RenderBG;
  43. }
  44.  
  45. @MainLoop{
  46. ObjEnemy_SetIntersectionCircleToShot(objBoss, ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 32);
  47. ObjEnemy_SetIntersectionCircleToPlayer(objBoss, ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 24);
  48.  
  49.  
  50. yield;
  51. }
  52. task MainTask{
  53. wait(120);
  54. movement;
  55. magiccircle(objBoss,size,type);
  56.  
  57. txt;
  58. }
  59.  
  60. task magiccircle(objBoss,size,type){
  61. let obj=ObjPrim_Create(OBJ_SPRITE_2D);
  62. let GCSD = GetCurrentScriptDirectory;
  63. let img=GCSD~"MG (2).png";
  64. let spin = 0;
  65. let s = 0;
  66. LoadTexture(img);
  67. ObjPrim_SetTexture(obj,img);
  68. ObjSprite2D_SetSourceRect(obj,0,0,256,256);
  69. ObjSprite2D_SetDestCenter(obj);
  70. ObjRender_SetScaleXYZ(obj,size,size,size);
  71. ObjRender_SetAlpha(obj,230);
  72. Obj_SetRenderPriority(obj,0.35);
  73. while(!Obj_IsDeleted(objBoss)){
  74. spin += 3;
  75. ObjRender_SetAngleXYZ(obj,0,0,-spin*1.5);
  76. ObjRender_SetPosition(obj,ObjMove_GetX(objBoss),ObjMove_GetY(objBoss),0);
  77. if(type==true){
  78. ObjRender_SetScaleXYZ(obj,size+0.2*sin(spin),size+0.2*sin(spin),0);
  79. }
  80. ObjMove_SetPosition(obj,ObjMove_GetX(objBoss), ObjMove_GetY(objBoss));
  81. yield;
  82. }
  83. Obj_Delete(obj);
  84. }
  85.  
  86. task txt{
  87. let objText = ObjText_Create();
  88. ObjText_SetText(objText, "Sin Sign - Hall of Death");
  89. ObjText_SetFontSize(objText, 10);
  90. ObjText_SetFontType(objText, "Russell Square Regular");
  91. ObjText_SetFontBold(objText, true);
  92. ObjText_SetFontColorTop(objText, 255, 255, 255);
  93. ObjText_SetFontColorBottom(objText, 255, 255, 255);
  94. ObjText_SetFontBorderType(objText, BORDER_FULL);
  95. ObjText_SetFontBorderColor(objText, 104, 64, 192);
  96. ObjText_SetFontBorderWidth(objText, 1);
  97. ObjText_SetHorizontalAlignment(objText, ALIGNMENT_LEFT);
  98. ObjText_SetMaxWidth(objText, 300);
  99. ObjRender_SetX(objText, -100 - -300);
  100. }
  101.  
  102. task RenderBG{
  103. let path1 = GetCurrentScriptDirectory() ~ "Muenzuka.png";
  104. let obj1 = ObjPrim_Create(OBJ_SPRITE_2D);
  105. ObjRender_SetBlendType(obj1, BLEND_ALPHA);
  106. Obj_SetRenderPriority(obj1, 0.21);
  107. ObjPrim_SetTexture(obj1, path1);
  108. ObjSprite2D_SetSourceRect(obj1, 0, 0, 512, 512);
  109. ObjSprite2D_SetDestRect(obj1, -256, -256, 256, 256);
  110. ObjRender_SetPosition(obj1, 384/2, 448/2, 1);
  111. let frame = 0;
  112. let alpha = 0;
  113. yield;
  114. }
  115.  
  116. task movement{
  117. while(ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0){
  118. ObjMove_SetDestAtFrame(objBoss, rand(GetCenterX + 90, GetCenterX - 90), rand(GetCenterY - 60, GetCenterY - 120), 60);
  119. wait(240);
  120. }
  121. }
  122.  
  123. task TDrawLoop {
  124. let imgBoss = GetCurrentScriptDirectory() ~ "shikieiki.png.png";
  125. ObjPrim_SetTexture(objBoss, imgBoss);
  126. ObjSprite2D_SetSourceRect(objBoss, 0, 0, 148, 125);
  127. ObjSprite2D_SetDestCenter(objBoss);
  128. }
  129. task TFinalize {
  130. while(ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0){yield;}
  131. if(ObjEnemyBossScene_GetInfo(objScene, INFO_PLAYER_SHOOTDOWN_COUNT)
  132. +ObjEnemyBossScene_GetInfo(objScene, INFO_PLAYER_SPELL_COUNT) == 0){
  133. AddScore(ObjEnemyBossScene_GetInfo(objScene, INFO_SPELL_SCORE));
  134. }
  135. Obj_Delete(objBoss);
  136. DeleteShotAll(TYPE_ALL,TYPE_IMMEDIATE);
  137. SetAutoDeleteObject(true);
  138. CloseScript(GetOwnScriptID());
  139. return;
  140. }
  141.  
  142.  
  143. function wait(n){
  144. loop(n){yield;}
  145. }
RAW Paste Data