Guest User

Untitled

a guest
Jun 16th, 2018
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.99 KB | None | 0 0
  1. #TouhouDanmakufu[Stage]
  2. #Title["(1) 3D stage (N)"]
  3. #Text["(1) 3D Stage (N)"]
  4. #ScriptVersion[3]
  5. #System["./system/SystemAlt.dnh"]
  6. #Background["./(1)StageBG.dnh"]
  7. #Player["script/player/ReimuA/playerreimu.dnh", "script/player/MarisaA/playermarisa.dnh"]
  8. #include "./lib_enemy.dnh"
  9. #include "./lib_dialogue.dnh"
  10. #include "./lib_sound.dnh"
  11. #include "./Shot Sheet/AllStarShot_Const.txt"
  12. #include "./lib_boss.dnh"
  13.  
  14. let stagepart = 0;
  15. CreateCommonDataArea("Stage part");
  16. SetAreaCommonData("Stage part", "Stagepart", stagepart);
  17. SaveCommonDataAreaA1("Stage part");
  18. let bSpell = false;
  19.  
  20. let CSD = GetCurrentScriptDirectory;
  21.  
  22. let Global = 0;
  23.  
  24. let text = ObjText_Create;
  25. let time = 0;
  26. ObjRender_SetY(text, 224);
  27.  
  28. function wait(n){
  29. loop(n){
  30. yield;
  31. }
  32. }
  33. function rand_int(min, max){
  34. return round(rand(min, max))
  35. }
  36. function GetCenterX(){
  37. return GetStgFrameWidth() / 2;
  38. }
  39.  
  40. function GetCenterY(){
  41. return GetStgFrameHeight() / 2;
  42. }
  43. function MyStageID{
  44. return GetCommonData("Main Stage Script ID", 0);
  45. }
  46.  
  47. @Event {
  48. alternative(GetEventType())
  49. case(EV_PAUSE_ENTER){
  50. if(stagepart == 0){
  51. ObjSound_Stop(bgm1);
  52. }
  53. if(stagepart == 1){
  54. ObjSound_Stop(bgm2);
  55. }
  56. }
  57. case(EV_PAUSE_LEAVE){
  58. if(stagepart == 0){
  59. ObjSound_Play(bgm1);
  60. }
  61. if(stagepart == 1){
  62. ObjSound_Play(bgm2);
  63. }
  64. }
  65. case(EV_USER_STAGE){
  66. let arguments = GetEventArgument(0);
  67. let spawnType = arguments[0];
  68. let spawnX = arguments[1];
  69. let spawnY = arguments[2];
  70. let spawnScore = arguments[3];
  71. CreateItemA1(spawnType, spawnX, spawnY, spawnScore);
  72. }
  73. }
  74.  
  75. @Initialize{
  76. SetCommonData("StageID", GetOwnScriptID());
  77. LoadCommonDataAreaA2("Value", "./CDarea.dnh");
  78. SetPauseScriptPath(GetCurrentScriptDirectory() ~ "./system/Pause.dnh");
  79. SetEndSceneScriptPath(GetCurrentScriptDirectory() ~ "./system/EndScene.dnh");
  80. SetCommonData("Main Stage Script ID", GetOwnScriptID());
  81. TStage;
  82. StartItemScript(GetCurrentScriptDirectory ~ "Items.dnh");
  83. }
  84.  
  85. @MainLoop{
  86. Global ++;
  87. if(Global >= 60){
  88. Global = 0;
  89. time ++;
  90. }
  91. LoadCommonDataAreaA2("Boss Spell", "./CDarea.dnh");
  92. if(GetAreaCommonData("Boss Spell", "Active", false) == true){
  93. bSpell = true;
  94. }else{
  95. bSpell = false;
  96. }
  97. yield;
  98. }
  99.  
  100. @Finalize{
  101.  
  102. }
  103.  
  104. task TStage{
  105. BossAppear;
  106. wait(120);
  107. DrawLoop(120, 0);
  108.  
  109. let idScript = LoadScriptInThread(GetCurrentScriptDirectory() ~ "(1) Plural Mid (N).dnh");
  110. StartScript(idScript);
  111. while(!IsCloseScript(idScript)){
  112. yield;
  113. }
  114. dialogue = 0;
  115.  
  116. SetAreaCommonData("Stage part", "Stagepart", 1);
  117. SaveCommonDataAreaA1("Stage part");
  118. SetCommonData("MC", true);
  119. idScript = LoadScriptInThread(GetCurrentScriptDirectory() ~ "(1) Plural Boss (N).dnh");
  120. stagepart = 1;
  121. StartScript(idScript);
  122. while(!IsCloseScript(idScript)){
  123. yield;
  124. }
  125. wait(120);
  126. CloseStgScene();
  127. }
Advertisement
Add Comment
Please, Sign In to add comment