Advertisement
Guest User

h

a guest
Jan 13th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.56 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.  
  7. let stagepart;
  8. let bgm;
  9. let bgm2;
  10.  
  11. @Initialize{
  12.     TStage();//main task of the script
  13. }
  14. @Event {
  15.     alternative(GetEventType())
  16.     case(EV_PAUSE_ENTER){
  17.         if(stagepart == 0){
  18.             ObjSound_Stop(bgm);
  19.         }
  20.         if(stagepart == 1){
  21.             ObjSound_Stop(bgm2);
  22.         }
  23.     }
  24.     case(EV_PAUSE_LEAVE){
  25.         if(stagepart == 0){
  26.             ObjSound_Play(bgm);
  27.         }
  28.         if(stagepart == 1){
  29.             ObjSound_Play(bgm2);
  30.         }
  31.     }
  32. }
  33.  
  34. task TStage{
  35.     let dir = GetCurrentScriptDirectory();
  36.    
  37.     let pathmidboss = dir ~ "Mr. Hat.txt";
  38.     let pathboss = dir ~ "Mr. Eye.txt"; //define a path for the plural
  39.     let midbossScript = LoadScriptInThread(pathmidboss);
  40.     let bossScript = LoadScriptInThread(pathboss);//loading it
  41.    
  42.     bgm2 = ObjSound_Create();
  43.     ObjSound_Load(bgm2, dir ~ "./bgm/SHITORI.ogg");
  44.     StageBGM(bgm2, 2);
  45.     bgm = ObjSound_Create();
  46.     ObjSound_Load(bgm, dir ~ "./bgm/KOISHIT.ogg");
  47.     StageBGM(bgm, 1);
  48.     ObjSound_Play(bgm);
  49.    
  50.     loop(60){yield;}//waits for the loading
  51.    
  52.     //Midboss
  53.     StartScript(midbossScript);
  54.     while(!IsCloseScript(midbossScript) && GetPlayerState() != STATE_END){
  55.         yield;
  56.     }
  57.    
  58.     loop(120){yield;}
  59.    
  60.     //Boss
  61.     stagepart = 1;
  62.     ObjSound_Stop(bgm);
  63.     ObjSound_Play(bgm2);
  64.     StartScript(bossScript);
  65.     while(!IsCloseScript(bossScript) && GetPlayerState() != STATE_END){
  66.         yield;
  67.     }
  68.  
  69.     //Once either ceases to be true, the stage waits a bit and then closes
  70.     loop(240){yield;}
  71.  
  72.     //which closes the stage formally
  73.     CloseStgScene();
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement