BananaCupcake

Untitled

Sep 1st, 2017
92
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. // 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.  
  14. #include "script/function_cutin.txt"
  15.  
  16. @Initialize {
  17.  
  18. // Cutin call function! Add or remove double slashes to check them out.
  19. cutin(NAZRIN,cut,0,0,676,664);
  20. //cutin(BYAKUREN,cut,0,0,676,664);
  21. //cutin(KANAKO,cut,0,0,676,664);
  22.  
  23. objBoss = ObjEnemy_Create(OBJ_ENEMY_BOSS);
  24. ObjEnemy_Regist(objBoss);
  25. ObjMove_SetDestAtFrame(objBoss, GetCenterX, 100, 100);
  26. ObjEnemyBossScene_StartSpell(objScene);
  27. TDrawLoop;
  28. TFinalize;
  29. MainTask;
  30. RenderBG;
  31. }
  32.  
  33. @Event {
  34. alternative(GetEventType())
  35. case(EV_REQUEST_LIFE) {
  36. SetScriptResult(1);
  37. }
  38. }
  39.  
  40. @MainLoop {
  41. yield;
  42. }
  43.  
  44. task MainTask{
  45. wait(120);
  46.  
  47. magiccircle(objBoss,size,type);
  48.  
  49. }
  50.  
  51. task RenderBG{
  52. let path1 = GetCurrentScriptDirectory() ~ "Muenzuka.png";
  53. let obj1 = ObjPrim_Create(OBJ_SPRITE_2D);
  54. ObjRender_SetBlendType(obj1, BLEND_ALPHA);
  55. Obj_SetRenderPriority(obj1, 0.21);
  56. ObjPrim_SetTexture(obj1, path1);
  57. ObjSprite2D_SetSourceRect(obj1, 0, 0, 512, 512);
  58. ObjSprite2D_SetDestRect(obj1, -256, -256, 256, 256);
  59. ObjRender_SetPosition(obj1, 384/2, 448/2, 1);
  60. let frame = 0;
  61. let alpha = 0;
  62. yield;
  63. }
  64.  
  65. task magiccircle(objBoss,size,type){
  66. let obj=ObjPrim_Create(OBJ_SPRITE_2D);
  67. let GCSD = GetCurrentScriptDirectory;
  68. let img=GCSD~"MG (3).png";
  69. let spin = 0;
  70. let s = 0;
  71. LoadTexture(img);
  72. ObjPrim_SetTexture(obj,img);
  73. ObjSprite2D_SetSourceRect(obj,0,0,256,256);
  74. ObjSprite2D_SetDestCenter(obj);
  75. ObjRender_SetScaleXYZ(obj,size,size,size);
  76. ObjRender_SetAlpha(obj,230);
  77. Obj_SetRenderPriority(obj,0.35);
  78. while(!Obj_IsDeleted(objBoss)){
  79. spin += 3;
  80. ObjRender_SetAngleXYZ(obj,0,0,-spin*1.5);
  81. ObjRender_SetPosition(obj,ObjMove_GetX(objBoss),ObjMove_GetY(objBoss),0);
  82. if(type==true){
  83. ObjRender_SetScaleXYZ(obj,size+0.08*sin(spin),size+0.08*sin(spin),0);
  84. }
  85. ObjMove_SetPosition(obj,ObjMove_GetX(objBoss), ObjMove_GetY(objBoss));
  86. yield;
  87. }
  88. Obj_Delete(obj);
  89. }
  90.  
  91. task TDrawLoop {
  92. let imgBoss = GetCurrentScriptDirectory() ~ "shikieiki.png.png";
  93. ObjPrim_SetTexture(objBoss, imgBoss);
  94. ObjSprite2D_SetSourceRect(objBoss, 0, 0, 148, 125);
  95. ObjSprite2D_SetDestCenter(objBoss);
  96. }
  97.  
  98. task TFinalize{
  99. while(ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0){yield;}
  100. if(ObjEnemyBossScene_GetInfo(objScene, INFO_PLAYER_SHOOTDOWN_COUNT)
  101. +ObjEnemyBossScene_GetInfo(objScene, INFO_PLAYER_SPELL_COUNT) == 0){
  102. AddScore(ObjEnemyBossScene_GetInfo(objScene, INFO_SPELL_SCORE));
  103. }
  104. Obj_Delete(objBoss);
  105. DeleteShotAll(TYPE_ALL,TYPE_IMMEDIATE);
  106. SetAutoDeleteObject(true);
  107. CloseScript(GetOwnScriptID());
  108. return;
  109. }
  110.  
  111. function wait(n){
  112. loop(n){yield;}
  113. }
RAW Paste Data