Advertisement
Guest User

My Stage

a guest
Jan 15th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.40 KB | None | 0 0
  1. #東方弾幕風[Stage]
  2. #ScriptVersion[3]
  3. #Title["The Koimeiji Sisters"]
  4. #Text["I'm going to blow your mind!"]
  5. #Background["./BG.txt"]
  6. #Player["./player/Reimu by plasmaflame22/Reimu_A.txt", "./player/Reimu by plasmaflame22/Reimu_B.txt", "./player/Reimu by plasmaflame22/Reimu_C.txt", "./player/Reimu(Mr. Blue)/Reimu.txt", "./player/Ultima's DDC Reimu B/ReimuH.dnh", "./player/gt_medicine/PracticeP.txt"]
  7.  
  8. let stagepart = 0;
  9. let bgm;
  10. let bgm2;
  11.  
  12. @Initialize{
  13. TStage();//main task of the script
  14. SetPlayerLife(10);
  15. SetPlayerSpell(5);
  16. }
  17. @Event {
  18. alternative(GetEventType())
  19. case(EV_PAUSE_ENTER){
  20. if(stagepart == 0){
  21. ObjSound_Stop(bgm);
  22. }
  23. if(stagepart == 1){
  24. ObjSound_Stop(bgm2);
  25. }
  26. }
  27. case(EV_PAUSE_LEAVE){
  28. if(stagepart == 0){
  29. ObjSound_Play(bgm);
  30. }
  31. if(stagepart == 1){
  32. ObjSound_Play(bgm2);
  33. }
  34. }
  35. }
  36. @MainLoop{
  37. yield;
  38. }
  39.  
  40. @Finalize{
  41. }
  42.  
  43.  
  44. task TStage{
  45. let dir = GetCurrentScriptDirectory();
  46.  
  47. let pathmidboss = dir ~ "Mr. Hat.txt";
  48. let pathboss = dir ~ "Mr. Eye.txt"; //define a path for the plural
  49. let midbossScript = LoadScriptInThread(pathmidboss);
  50. let bossScript = LoadScriptInThread(pathboss);//loading it
  51.  
  52. bgm2 = ObjSound_Create();
  53. ObjSound_Load(bgm2, dir ~ "./bgm/SHITORI.ogg");
  54. StageBGM(bgm2, 2);
  55. bgm = ObjSound_Create();
  56. ObjSound_Load(bgm, dir ~ "./bgm/KOISHIT.ogg");
  57. StageBGM(bgm, 1);
  58. ObjSound_Play(bgm);
  59.  
  60. loop(60){yield;}//waits for the loading
  61.  
  62. //Midboss
  63. StartScript(midbossScript);
  64. while(!IsCloseScript(midbossScript) && GetPlayerState() != STATE_END){
  65. yield;
  66. }
  67.  
  68. loop(120){yield;}
  69.  
  70. //Boss
  71. stagepart = 1;
  72. ObjSound_Stop(bgm);
  73. ObjSound_Play(bgm2);
  74. StartScript(bossScript);
  75. while(!IsCloseScript(bossScript) && GetPlayerState() != STATE_END){
  76. yield;
  77. }
  78.  
  79. //Once either ceases to be true, the stage waits a bit and then closes
  80. loop(240){yield;}
  81.  
  82. //which closes the stage formally
  83. CloseStgScene();
  84. }
  85. function SoundBGM(path){
  86. let obj = ObjSound_Create();
  87. ObjSound_Load(obj, path);
  88. ObjSound_SetSoundDivision(obj, SOUND_BGM);
  89. ObjSound_SetVolumeRate(obj, 100);
  90. return obj;
  91. }
  92. function StageBGM(obj, ID){
  93. ObjSound_SetSoundDivision(obj, SOUND_BGM);
  94. ObjSound_SetRestartEnable(obj, true);
  95. ObjSound_SetLoopEnable(obj, true);
  96. ObjSound_SetLoopTime(obj, 0, 300);
  97. if(ID == 1){ObjSound_SetLoopTime(obj, 2, 120);}
  98. if(ID == 2){ObjSound_SetLoopTime(obj, 0, 240);}
  99. return obj;
  100. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement