Advertisement
Guest User

Untitled

a guest
Nov 28th, 2011
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.31 KB | None | 0 0
  1. #TouhouDanmakufu[Stage]
  2. #ScriptVersion[3]
  3. #Title["Ancient Legend Resurrection"]
  4. #System["./system/System.dnh"]
  5. #Player["script/player/youkaihunters/YoukaiHunters.txt"]
  6.  
  7. #include "./system/StageFunctions.dnh"
  8. #include "./enemy/st1enm.dnh"
  9. #include "./enemy/st2enm.dnh"
  10. #include "./enemy/st3enm.dnh"
  11. #include "./enemy/st4enm.dnh"
  12. #include "./enemy/st5enm.dnh"
  13. #include "./enemy/st6enm.dnh"
  14. #include "./enemy/stEXenm.dnh"
  15. #include "./enemy/stPHenm.dnh"
  16.  
  17. let phase = "MENU";
  18. let difficultySelectType;
  19. let difficulty;
  20. let stage = 0;
  21. let practice = false;
  22. let menu = ObjPrim_Create(OBJ_SPRITE_2D);
  23. let menuImg = img_system ~ "Menu.png";
  24. let subImg = img_system ~ "Submenu.png";
  25. let menuCursor = 0;
  26. let subCursor = 0;
  27. let chosenSong = 0;
  28. let Bgm;
  29. let scene;
  30. //let timer = 0;
  31.  
  32. @Initialize{
  33. LoadSoundEffects;
  34. LoadTextures;
  35. RenderBackground;
  36. MainTask;
  37. }
  38.  
  39. @MainLoop{
  40. yield;
  41. }
  42.  
  43. task MainTask
  44. {
  45. loop{
  46. alternative(phase)
  47. case("MENU"){
  48. Bgm = PlayMusic("BgmTitle.ogg",0,0);
  49. SetForbidPlayerShot(true);
  50. SetForbidPlayerSpell(true);
  51. ObjPrim_SetTexture(menu, menuImg);
  52. Obj_SetRenderPriority(menu, 0.9);
  53. ObjSprite2D_SetSourceRect(menu, 0, 0, 640, 480);
  54. ObjSprite2D_SetDestRect(menu, 0, 0, 640, 480);
  55. let startOption = CreateMenuOption("Game Start", 434, 150);
  56. let extraOption = CreateMenuOption("Extra Start", 434, 176);
  57. let practiceOption = CreateMenuOption("Practice Start", 434, 202);
  58. let spellOption = CreateMenuOption("Spell Practice", 434, 228);
  59. let musicOption = CreateMenuOption("Music Room", 434, 254);
  60. while(phase=="MENU"){
  61. if(menuCursor==0){
  62. ObjText_SetFontColorTop(startOption, 255, 255, 255);
  63. ObjText_SetFontColorBottom(startOption, 255, 128, 0);
  64. }else{
  65. ObjText_SetFontColorTop(startOption, 255, 255, 255);
  66. ObjText_SetFontColorBottom(startOption, 128, 64, 0);
  67. }
  68. if(menuCursor==1){
  69. ObjText_SetFontColorTop(extraOption, 255, 255, 255);
  70. ObjText_SetFontColorBottom(extraOption, 255, 128, 0);
  71. }else{
  72. ObjText_SetFontColorTop(extraOption, 255, 255, 255);
  73. ObjText_SetFontColorBottom(extraOption, 128, 64, 0);
  74. }
  75. if(menuCursor==2){
  76. ObjText_SetFontColorTop(practiceOption, 255, 255, 255);
  77. ObjText_SetFontColorBottom(practiceOption, 255, 128, 0);
  78. }else{
  79. ObjText_SetFontColorTop(practiceOption, 255, 255, 255);
  80. ObjText_SetFontColorBottom(practiceOption, 128, 64, 0);
  81. }
  82. if(menuCursor==3){
  83. ObjText_SetFontColorTop(spellOption, 255, 255, 255);
  84. ObjText_SetFontColorBottom(spellOption, 255, 128, 0);
  85. }else{
  86. ObjText_SetFontColorTop(spellOption, 255, 255, 255);
  87. ObjText_SetFontColorBottom(spellOption, 128, 64, 0);
  88. }
  89. if(menuCursor==4){
  90. ObjText_SetFontColorTop(musicOption, 255, 255, 255);
  91. ObjText_SetFontColorBottom(musicOption, 255, 128, 0);
  92. }else{
  93. ObjText_SetFontColorTop(musicOption, 255, 255, 255);
  94. ObjText_SetFontColorBottom(musicOption, 128, 64, 0);
  95. }
  96. if(GetVirtualKeyState(VK_DOWN)==KEY_PUSH){
  97. menuCursor++;
  98. PlaySE(Select);
  99. if(menuCursor>4){
  100. menuCursor = 0;
  101. }
  102. }else if(GetVirtualKeyState(VK_UP)==KEY_PUSH){
  103. menuCursor--;
  104. PlaySE(Select);
  105. if(menuCursor<0){
  106. menuCursor = 4;
  107. }
  108. }
  109. if(GetVirtualKeyState(VK_SHOT)==KEY_PUSH){
  110. PlaySE(SelectOk);
  111. alternative(menuCursor)
  112. case(0){
  113. phase = "DIFFICULTY";
  114. difficultySelectType = "GAME";
  115. }
  116. case(1){
  117. phase = "DIFFICULTY";
  118. difficultySelectType = "EXTRA";
  119. }
  120. case(2){
  121. phase = "DIFFICULTY";
  122. difficultySelectType = "PRACTICE";
  123. }
  124. case(3){
  125. phase = "SPRACTICE";
  126. }
  127. case(4){
  128. phase = "MUSIC";
  129. }
  130. Obj_Delete(startOption);
  131. Obj_Delete(extraOption);
  132. Obj_Delete(practiceOption);
  133. Obj_Delete(spellOption);
  134. Obj_Delete(musicOption);
  135. }
  136. yield;
  137. }
  138. }
  139. case("DIFFICULTY"){
  140. subCursor = 0;
  141. ObjPrim_SetTexture(menu, subImg);
  142. Obj_SetRenderPriority(menu, 0.91);
  143. ObjSprite2D_SetSourceRect(menu, 0, 0, 640, 480);
  144. ObjSprite2D_SetDestRect(menu, 0, 0, 640, 480);
  145. let easyOpt;
  146. let normalOpt;
  147. let hardOpt;
  148. let lunaticOpt;
  149. let extraOpt;
  150. let phantasmOpt;
  151. if(difficultySelectType != "EXTRA"){
  152. easyOpt = CreateSubMenuOption("EASY", 0, 108, 48);
  153. normalOpt = CreateSubMenuOption("NORMAL", 0, 180, 48);
  154. hardOpt = CreateSubMenuOption("HARD", 0, 252, 48);
  155. lunaticOpt = CreateSubMenuOption("LUNATIC", 0, 324, 48);
  156. ObjText_SetMaxWidth(easyOpt, 640);
  157. ObjText_SetHorizontalAlignment(easyOpt, ALIGNMENT_CENTER);
  158. ObjText_SetMaxWidth(normalOpt, 640);
  159. ObjText_SetHorizontalAlignment(normalOpt, ALIGNMENT_CENTER);
  160. ObjText_SetMaxWidth(hardOpt, 640);
  161. ObjText_SetHorizontalAlignment(hardOpt, ALIGNMENT_CENTER);
  162. ObjText_SetMaxWidth(lunaticOpt, 640);
  163. ObjText_SetHorizontalAlignment(lunaticOpt, ALIGNMENT_CENTER);
  164. }else{
  165. extraOpt = CreateSubMenuOption("EXTRA", 0, 180, 48);
  166. phantasmOpt = CreateSubMenuOption("PHANTASM", 0, 252, 48);
  167. ObjText_SetMaxWidth(extraOpt, 640);
  168. ObjText_SetHorizontalAlignment(extraOpt, ALIGNMENT_CENTER);
  169. ObjText_SetMaxWidth(phantasmOpt, 640);
  170. ObjText_SetHorizontalAlignment(phantasmOpt, ALIGNMENT_CENTER);
  171. }
  172. while(phase=="DIFFICULTY"){
  173. if(difficultySelectType != "EXTRA"){
  174. if(subCursor==0){
  175. ObjText_SetFontColorTop(easyOpt, 255, 255, 255);
  176. ObjText_SetFontColorBottom(easyOpt, 0, 255, 0);
  177. }else{
  178. ObjText_SetFontColorTop(easyOpt, 0, 255, 0);
  179. ObjText_SetFontColorBottom(easyOpt, 0, 128, 0);
  180. }
  181. if(subCursor==1){
  182. ObjText_SetFontColorTop(normalOpt, 255, 255, 255);
  183. ObjText_SetFontColorBottom(normalOpt, 255, 255, 0);
  184. }else{
  185. ObjText_SetFontColorTop(normalOpt, 255, 255, 0);
  186. ObjText_SetFontColorBottom(normalOpt, 128, 128, 0);
  187. }
  188. if(subCursor==2){
  189. ObjText_SetFontColorTop(hardOpt, 255, 255, 255);
  190. ObjText_SetFontColorBottom(hardOpt, 255, 128, 0);
  191. }else{
  192. ObjText_SetFontColorTop(hardOpt, 255, 128, 0);
  193. ObjText_SetFontColorBottom(hardOpt, 128, 64, 0);
  194. }
  195. if(subCursor==3){
  196. ObjText_SetFontColorTop(lunaticOpt, 255, 255, 255);
  197. ObjText_SetFontColorBottom(lunaticOpt, 255, 0, 0);
  198. }else{
  199. ObjText_SetFontColorTop(lunaticOpt, 255, 0, 0);
  200. ObjText_SetFontColorBottom(lunaticOpt, 128, 0, 0);
  201. }
  202. if(GetVirtualKeyState(VK_DOWN)==KEY_PUSH){
  203. subCursor++;
  204. PlaySE(Select);
  205. if(subCursor>3){
  206. subCursor = 0;
  207. }
  208. }else if(GetVirtualKeyState(VK_UP)==KEY_PUSH){
  209. subCursor--;
  210. PlaySE(Select);
  211. if(subCursor<0){
  212. subCursor = 3;
  213. }
  214. }
  215. }else{
  216. if(subCursor==0){
  217. ObjText_SetFontColorTop(extraOpt, 255, 255, 255);
  218. ObjText_SetFontColorBottom(extraOpt, 0, 0, 255);
  219. }else{
  220. ObjText_SetFontColorTop(extraOpt, 0, 0, 255);
  221. ObjText_SetFontColorBottom(extraOpt, 0, 0, 128);
  222. }
  223. if(subCursor==1){
  224. ObjText_SetFontColorTop(phantasmOpt, 255, 255, 255);
  225. ObjText_SetFontColorBottom(phantasmOpt, 255, 0, 255);
  226. }else{
  227. ObjText_SetFontColorTop(phantasmOpt, 255, 0, 255);
  228. ObjText_SetFontColorBottom(phantasmOpt, 128, 0, 128);
  229. }
  230. if(GetVirtualKeyState(VK_DOWN)==KEY_PUSH){
  231. subCursor++;
  232. PlaySE(Select);
  233. if(subCursor>1){
  234. subCursor = 0;
  235. }
  236. }else if(GetVirtualKeyState(VK_UP)==KEY_PUSH){
  237. subCursor--;
  238. PlaySE(Select);
  239. if(subCursor<0){
  240. subCursor = 1;
  241. }
  242. }
  243. }
  244. if(GetVirtualKeyState(VK_SHOT)==KEY_PUSH){
  245. PlaySE(SelectOk);
  246. SetDif(subCursor+1);
  247. phase = difficultySelectType;
  248. if(phase == "GAME"){
  249. ObjSound_Stop(Bgm);
  250. Obj_Delete(menu);
  251. Obj_Delete(easyOpt);
  252. Obj_Delete(normalOpt);
  253. Obj_Delete(hardOpt);
  254. Obj_Delete(lunaticOpt);
  255. SetForbidPlayerShot(false);
  256. SetForbidPlayerSpell(false);
  257. stage = 1;
  258. }else if(phase == "EXTRA"){
  259. ObjSound_Stop(Bgm);
  260. Obj_Delete(menu);
  261. Obj_Delete(extraOpt);
  262. Obj_Delete(phantasmOpt);
  263. SetForbidPlayerShot(false);
  264. SetForbidPlayerSpell(false);
  265. stage = subCursor + 8;
  266. }else{
  267. Obj_Delete(easyOpt);
  268. Obj_Delete(normalOpt);
  269. Obj_Delete(hardOpt);
  270. Obj_Delete(lunaticOpt);
  271. }
  272. }
  273. if(GetVirtualKeyState(VK_SPELL)==KEY_PUSH){
  274. PlaySE(SelectCancel);
  275. phase = "MENU";
  276. if(difficultySelectType != "EXTRA"){
  277. Obj_Delete(easyOpt);
  278. Obj_Delete(normalOpt);
  279. Obj_Delete(hardOpt);
  280. Obj_Delete(lunaticOpt);
  281. }else{
  282. Obj_Delete(extraOpt);
  283. Obj_Delete(phantasmOpt);
  284. }
  285. }
  286. yield;
  287. }
  288. }
  289. case("PRACTICE"){
  290. subCursor = 0;
  291. let s1Opt = CreateSubMenuOption("STAGE 1", 0, 36, 48);
  292. let s2Opt = CreateSubMenuOption("STAGE 2", 0, 96, 48);
  293. let s3Opt = CreateSubMenuOption("STAGE 3", 0, 156, 48);
  294. let s4Opt = CreateSubMenuOption("STAGE 4", 0, 216, 48);
  295. let s5Opt = CreateSubMenuOption("STAGE 5", 0, 276, 48);
  296. let s6Opt = CreateSubMenuOption("STAGE 6", 0, 336, 48);
  297. let s7Opt = CreateSubMenuOption("STAGE 7", 0, 396, 48);
  298. ObjText_SetMaxWidth(s1Opt, 640);
  299. ObjText_SetHorizontalAlignment(s1Opt, ALIGNMENT_CENTER);
  300. ObjText_SetMaxWidth(s2Opt, 640);
  301. ObjText_SetHorizontalAlignment(s2Opt, ALIGNMENT_CENTER);
  302. ObjText_SetMaxWidth(s3Opt, 640);
  303. ObjText_SetHorizontalAlignment(s3Opt, ALIGNMENT_CENTER);
  304. ObjText_SetMaxWidth(s4Opt, 640);
  305. ObjText_SetHorizontalAlignment(s4Opt, ALIGNMENT_CENTER);
  306. ObjText_SetMaxWidth(s5Opt, 640);
  307. ObjText_SetHorizontalAlignment(s5Opt, ALIGNMENT_CENTER);
  308. ObjText_SetMaxWidth(s6Opt, 640);
  309. ObjText_SetHorizontalAlignment(s6Opt, ALIGNMENT_CENTER);
  310. ObjText_SetMaxWidth(s7Opt, 640);
  311. ObjText_SetHorizontalAlignment(s7Opt, ALIGNMENT_CENTER);
  312. while(phase == "PRACTICE"){
  313. if(subCursor==0){
  314. ObjText_SetFontColorTop(s1Opt, 255, 255, 255);
  315. ObjText_SetFontColorBottom(s1Opt, 128, 128, 128);
  316. }else{
  317. ObjText_SetFontColorTop(s1Opt, 128, 128, 128);
  318. ObjText_SetFontColorBottom(s1Opt, 64, 64, 64);
  319. }
  320. if(subCursor==1){
  321. ObjText_SetFontColorTop(s2Opt, 255, 255, 255);
  322. ObjText_SetFontColorBottom(s2Opt, 128, 128, 128);
  323. }else{
  324. ObjText_SetFontColorTop(s2Opt, 128, 128, 128);
  325. ObjText_SetFontColorBottom(s2Opt, 64, 64, 64);
  326. }
  327. if(subCursor==2){
  328. ObjText_SetFontColorTop(s3Opt, 255, 255, 255);
  329. ObjText_SetFontColorBottom(s3Opt, 128, 128, 128);
  330. }else{
  331. ObjText_SetFontColorTop(s3Opt, 128, 128, 128);
  332. ObjText_SetFontColorBottom(s3Opt, 64, 64, 64);
  333. }
  334. if(subCursor==3){
  335. ObjText_SetFontColorTop(s4Opt, 255, 255, 255);
  336. ObjText_SetFontColorBottom(s4Opt, 128, 128, 128);
  337. }else{
  338. ObjText_SetFontColorTop(s4Opt, 128, 128, 128);
  339. ObjText_SetFontColorBottom(s4Opt, 64, 64, 64);
  340. }
  341. if(subCursor==4){
  342. ObjText_SetFontColorTop(s5Opt, 255, 255, 255);
  343. ObjText_SetFontColorBottom(s5Opt, 128, 128, 128);
  344. }else{
  345. ObjText_SetFontColorTop(s5Opt, 128, 128, 128);
  346. ObjText_SetFontColorBottom(s5Opt, 64, 64, 64);
  347. }
  348. if(subCursor==5){
  349. ObjText_SetFontColorTop(s6Opt, 255, 255, 255);
  350. ObjText_SetFontColorBottom(s6Opt, 128, 128, 128);
  351. }else{
  352. ObjText_SetFontColorTop(s6Opt, 128, 128, 128);
  353. ObjText_SetFontColorBottom(s6Opt, 64, 64, 64);
  354. }
  355. if(subCursor==6){
  356. ObjText_SetFontColorTop(s7Opt, 255, 255, 255);
  357. ObjText_SetFontColorBottom(s7Opt, 128, 128, 128);
  358. }else{
  359. ObjText_SetFontColorTop(s7Opt, 128, 128, 128);
  360. ObjText_SetFontColorBottom(s7Opt, 64, 64, 64);
  361. }
  362. if(GetVirtualKeyState(VK_DOWN)==KEY_PUSH){
  363. subCursor++;
  364. PlaySE(Select);
  365. if(subCursor>6){
  366. subCursor = 0;
  367. }
  368. }else if(GetVirtualKeyState(VK_UP)==KEY_PUSH){
  369. subCursor--;
  370. PlaySE(Select);
  371. if(subCursor<0){
  372. subCursor = 6;
  373. }
  374. }
  375. if(GetVirtualKeyState(VK_SHOT)==KEY_PUSH){
  376. phase = "GAME";
  377. PlaySE(SelectOk);
  378. ObjSound_Stop(Bgm);
  379. SetPlayerLife(10);
  380. practice = true;
  381. Obj_Delete(menu);
  382. Obj_Delete(s1Opt);
  383. Obj_Delete(s2Opt);
  384. Obj_Delete(s3Opt);
  385. Obj_Delete(s4Opt);
  386. Obj_Delete(s5Opt);
  387. Obj_Delete(s6Opt);
  388. Obj_Delete(s7Opt);
  389. SetForbidPlayerShot(false);
  390. SetForbidPlayerSpell(false);
  391. stage = subCursor + 1;
  392. }
  393. if(GetVirtualKeyState(VK_SPELL)==KEY_PUSH){
  394. PlaySE(SelectCancel);
  395. phase = "MENU";
  396. Obj_Delete(s1Opt);
  397. Obj_Delete(s2Opt);
  398. Obj_Delete(s3Opt);
  399. Obj_Delete(s4Opt);
  400. Obj_Delete(s5Opt);
  401. Obj_Delete(s6Opt);
  402. Obj_Delete(s7Opt);
  403. }
  404. yield;
  405. }
  406. }
  407. case("MUSIC"){
  408. subCursor = 0;
  409. chosenSong = 0;
  410. ObjPrim_SetTexture(menu, subImg);
  411. Obj_SetRenderPriority(menu, 0.91);
  412. ObjSprite2D_SetSourceRect(menu, 0, 0, 640, 480);
  413. ObjSprite2D_SetDestRect(menu, 0, 0, 640, 480);
  414. let musicName = CreateSubMenuOption("Cosmo Ruin", 0, 12, 24);
  415. let musicComment = CreateSubMenuOption("The title theme.", 0, 36, 24);
  416. let themeOpt = CreateSubMenuOption("1.Cosmo Ruin", 0, 226, 28);
  417. ObjText_SetMaxWidth(musicName, 640);
  418. ObjText_SetHorizontalAlignment(musicName, ALIGNMENT_CENTER);
  419. ObjText_SetMaxWidth(musicComment, 640);
  420. ObjText_SetHorizontalAlignment(musicComment, ALIGNMENT_CENTER);
  421. ObjText_SetMaxWidth(themeOpt, 640);
  422. ObjText_SetHorizontalAlignment(themeOpt, ALIGNMENT_CENTER);
  423. //let debug = ObjText_Create;
  424. //Obj_SetRenderPriority(debug, 0.91);
  425. while(phase=="MUSIC"){
  426. alternative(subCursor)
  427. case(0){
  428. ObjText_SetText(themeOpt, "1.Cosmo Ruin");
  429. }
  430. case(1){
  431. ObjText_SetText(themeOpt, "2.Paradigm Shift");
  432. }
  433. case(2){
  434. ObjText_SetText(themeOpt, "3.Crown of the Exposed Road ~ Evening Race");
  435. }
  436. case(3){
  437. ObjText_SetText(themeOpt, "4.Other Side of the Miracle");
  438. }
  439. case(4){
  440. ObjText_SetText(themeOpt, "5.Mirror Flower ~ Fantasy of Natural");
  441. }
  442. case(5){
  443. ObjText_SetText(themeOpt, "6.Sleeping in the Abyss ~ Endless Night");
  444. }
  445. case(6){
  446. ObjText_SetText(themeOpt, "7.World Deterioration ~ Field Collapse");
  447. }
  448. case(7){
  449. ObjText_SetText(themeOpt, "8.Rough Poem ~ Forgotten History");
  450. }
  451. case(8){
  452. ObjText_SetText(themeOpt, "9.Transmigration of Dissociation");
  453. }
  454. case(9){
  455. ObjText_SetText(themeOpt, "10.Midnight Fantasy Road ~ Lit Up Way");
  456. }
  457. case(10){
  458. ObjText_SetText(themeOpt, "11.Fantasia Reform ~ Before After");
  459. }
  460. case(11){
  461. ObjText_SetText(themeOpt, "12.Starlight Temple");
  462. }
  463. case(12){
  464. ObjText_SetText(themeOpt, "13.Rumble Temple");
  465. }
  466. case(13){
  467. ObjText_SetText(themeOpt, "14.Hydra's Fantasy ~ Novum Organum");
  468. }
  469. case(14){
  470. ObjText_SetText(themeOpt, "15.New Testament ~ Sol Eater");
  471. }
  472. case(15){
  473. ObjText_SetText(themeOpt, "16.In the End of the World Devastated");
  474. }
  475. case(16){
  476. ObjText_SetText(themeOpt, "17.Beginning of Zero ~ Miracle Side");
  477. }
  478. case(17){
  479. ObjText_SetText(themeOpt, "18.Invitation to the Crimson Star");
  480. }
  481. case(18){
  482. ObjText_SetText(themeOpt, "19.Carnival Syndrome");
  483. }
  484. case(19){
  485. ObjText_SetText(themeOpt, "20.Panic Grave");
  486. }
  487. case(20){
  488. ObjText_SetText(themeOpt, "21.Bell of the Night Sky ~ Quiet Time");
  489. }
  490. case(21){
  491. ObjText_SetText(themeOpt, "22.Tour to the Silhouette Stand ~ Overnight Dream");
  492. }
  493. case(22){
  494. ObjText_SetText(themeOpt, "23.Visited by God's Blessing ~ Forsaken Lamb");
  495. }
  496. alternative(chosenSong)
  497. case(0){
  498. ObjText_SetText(musicName, "Cosmo Ruin");
  499. ObjText_SetText(musicComment, "The title theme.");
  500. }
  501. case(1){
  502. ObjText_SetText(musicName, "Paradigm Shift");
  503. ObjText_SetText(musicComment, "The first stage theme.");
  504. }
  505. case(2){
  506. ObjText_SetText(musicName, "Crown of the Exposed Road ~ Evening Race");
  507. ObjText_SetText(musicComment, "Yukari Yakumo's theme.");
  508. }
  509. case(3){
  510. ObjText_SetText(musicName, "Other Side of the Miracle");
  511. ObjText_SetText(musicComment, "The second stage theme.");
  512. }
  513. case(4){
  514. ObjText_SetText(musicName, "Mirror Flower ~ Fantasy of Natural");
  515. ObjText_SetText(musicComment, "Kakiyuri Hanabatake's theme.");
  516. }
  517. case(5){
  518. ObjText_SetText(musicName, "Sleeping in the Abyss ~ Endless Night");
  519. ObjText_SetText(musicComment, "The third stage theme.");
  520. }
  521. case(6){
  522. ObjText_SetText(musicName, "World Deterioration ~ Field Collapse");
  523. ObjText_SetText(musicComment, "Kuraimori Chiyoru's theme.");
  524. }
  525. case(7){
  526. ObjText_SetText(musicName, "Rough Poem ~ Forgotten History");
  527. ObjText_SetText(musicComment, "The fourth stage theme.");
  528. }
  529. case(8){
  530. ObjText_SetText(musicName, "Transmigration of Dissociation");
  531. ObjText_SetText(musicComment, "Kiriwaru Monsorasu's theme.");
  532. }
  533. case(9){
  534. ObjText_SetText(musicName, "Midnight Fantasy Road ~ Lit Up Way");
  535. ObjText_SetText(musicComment, "The fifth stage theme.");
  536. }
  537. case(10){
  538. ObjText_SetText(musicName, "Fantasia Reform ~ Before After");
  539. ObjText_SetText(musicComment, "Kamirei Shuhaiwa's theme.");
  540. }
  541. case(11){
  542. ObjText_SetText(musicName, "Starlight Temple");
  543. ObjText_SetText(musicComment, "The sixth stage theme.");
  544. }
  545. case(12){
  546. ObjText_SetText(musicName, "Rumble Temple");
  547. ObjText_SetText(musicComment, "Suisho Azayaka's theme.");
  548. }
  549. case(13){
  550. ObjText_SetText(musicName, "Hydra's Fantasy ~ Novum Organum");
  551. ObjText_SetText(musicComment, "The last spell theme.");
  552. }
  553. case(14){
  554. ObjText_SetText(musicName, "New Testament ~ Sol Eater");
  555. ObjText_SetText(musicComment, "The seventh stage theme.");
  556. }
  557. case(15){
  558. ObjText_SetText(musicName, "In the End of the World Devastated");
  559. ObjText_SetText(musicComment, "Hakaishi Kaimetsu's theme.");
  560. }
  561. case(16){
  562. ObjText_SetText(musicName, "Beginning of Zero ~ Miracle Side");
  563. ObjText_SetText(musicComment, "The extra stage theme.");
  564. }
  565. case(17){
  566. ObjText_SetText(musicName, "Invitation to the Crimson Star");
  567. ObjText_SetText(musicComment, "Aotsuki Chiyoru's theme.");
  568. }
  569. case(18){
  570. ObjText_SetText(musicName, "Carnival Syndrome");
  571. ObjText_SetText(musicComment, "The phantasm stage theme.");
  572. }
  573. case(19){
  574. ObjText_SetText(musicName, "Panic Grave");
  575. ObjText_SetText(musicComment, "Ryuho Kodaishohi's theme.");
  576. }
  577. case(20){
  578. ObjText_SetText(musicName, "Bell of the Night Sky ~ Quiet Time");
  579. ObjText_SetText(musicComment, "The ending theme.");
  580. }
  581. case(21){
  582. ObjText_SetText(musicName, "Tour to the Silhouette Stand ~ Overnight Dream");
  583. ObjText_SetText(musicComment, "The credits theme.");
  584. }
  585. case(22){
  586. ObjText_SetText(musicName, "Visited by God's Blessing ~ Forsaken Lamb");
  587. ObjText_SetText(musicComment, "The last word theme.");
  588. }
  589. if(GetVirtualKeyState(VK_RIGHT)==KEY_PUSH){
  590. subCursor++;
  591. PlaySE(Select);
  592. if(subCursor>22){
  593. subCursor = 0;
  594. }
  595. }else if(GetVirtualKeyState(VK_LEFT)==KEY_PUSH){
  596. subCursor--;
  597. PlaySE(Select);
  598. if(subCursor<0){
  599. subCursor = 22;
  600. }
  601. }
  602. if(GetVirtualKeyState(VK_DOWN)==KEY_PUSH){
  603. subCursor++;
  604. PlaySE(Select);
  605. if(subCursor>22){
  606. subCursor = 0;
  607. }
  608. }else if(GetVirtualKeyState(VK_UP)==KEY_PUSH){
  609. subCursor--;
  610. PlaySE(Select);
  611. if(subCursor<0){
  612. subCursor = 22;
  613. }
  614. }
  615. if(GetVirtualKeyState(VK_SHOT)==KEY_PUSH){
  616. chosenSong = subCursor;
  617. ObjSound_Stop(Bgm);
  618. //timer = 0;
  619. yield;
  620. alternative(subCursor)
  621. case(0){
  622. Bgm = PlayMusic("BgmTitle.ogg", 0, 0);
  623. }
  624. case(1){
  625. Bgm = PlayMusic("BgmS1.ogg", 0, 0);
  626. }
  627. case(2){
  628. Bgm = PlayMusic("BgmYukari.ogg", 0.9, 94.9);
  629. }
  630. case(3){
  631. Bgm = PlayMusic("BgmS2.ogg", 0, 0);
  632. }
  633. case(4){
  634. Bgm = PlayMusic("BgmKakiyuri.ogg", 9.24, 181);
  635. }
  636. case(5){
  637. Bgm = PlayMusic("BgmS3.ogg", 0, 0);
  638. }
  639. case(6){
  640. Bgm = PlayMusic("BgmKuraimori.ogg", 10.95, 188.3);
  641. }
  642. case(7){
  643. Bgm = PlayMusic("BgmS4.ogg", 0, 0);
  644. }
  645. case(8){
  646. Bgm = PlayMusic("BgmKiriwaru.ogg", 0, 0);
  647. }
  648. case(9){
  649. Bgm = PlayMusic("BgmS5.ogg", 0, 0);
  650. }
  651. case(10){
  652. Bgm = PlayMusic("BgmKamirei.ogg", 0, 0);
  653. }
  654. case(11){
  655. Bgm = PlayMusic("BgmS6.ogg", 0, 0);
  656. }
  657. case(12){
  658. Bgm = PlayMusic("BgmSuisho.ogg", 0, 0);
  659. }
  660. case(13){
  661. Bgm = PlayMusic("BgmLS.ogg", 0, 0);
  662. }
  663. case(14){
  664. Bgm = PlayMusic("BgmS7.ogg", 0, 0);
  665. }
  666. case(15){
  667. Bgm = PlayMusic("BgmHakaishi.ogg", 0, 0);
  668. }
  669. case(16){
  670. Bgm = PlayMusic("BgmSEx.ogg", 0, 0);
  671. }
  672. case(17){
  673. Bgm = PlayMusic("BgmAotsuki.ogg", 0, 0);
  674. }
  675. case(18){
  676. Bgm = PlayMusic("BgmSPh.ogg", 0, 0);
  677. }
  678. case(19){
  679. Bgm = PlayMusic("BgmRyuho.ogg", 0, 0);
  680. }
  681. case(20){
  682. Bgm = PlayMusic("BgmEnd.ogg", 0, 0);
  683. }
  684. case(21){
  685. Bgm = PlayMusic("BgmCredits.ogg", 0, 0);
  686. }
  687. case(22){
  688. Bgm = PlayMusic("BgmLW.ogg", 0, 0);
  689. }
  690. }
  691. if(GetVirtualKeyState(VK_SPELL)==KEY_PUSH){
  692. PlaySE(SelectCancel);
  693. phase = "MENU";
  694. Obj_Delete(musicName);
  695. Obj_Delete(musicComment);
  696. Obj_Delete(themeOpt);
  697. ObjSound_Stop(Bgm);
  698. }
  699. if(subCursor==chosenSong){
  700. ObjText_SetFontColorTop(themeOpt, 255, 255, 255);
  701. ObjText_SetFontColorBottom(themeOpt, 255, 255, 0);
  702. }else{
  703. ObjText_SetFontColorTop(themeOpt, 128, 128, 128);
  704. ObjText_SetFontColorBottom(themeOpt, 64, 64, 64);
  705. }
  706. //timer+=1/60;
  707. //ObjText_SetText(debug, timer);
  708. yield;
  709. }
  710. }
  711. case("GAME"){
  712. loop{
  713. alternative(stage)
  714. case(1){
  715. Bgm = PlayMusic("BgmS1.ogg", 0, 0);
  716. //Pre midboss
  717. TWait(180);
  718. //Midboss
  719. scene = ObjEnemyBossScene_Create();
  720. ObjEnemyBossScene_Add(scene, 0, "./boss/RanN1.dnh");
  721. if(GetDif>2){
  722. //ObjEnemyBossScene_Add(scene, 0, "./boss/RanS1.dnh");
  723. }
  724. ObjEnemyBossScene_LoadInThread(scene);
  725. ObjEnemyBossScene_Regist(scene);
  726. while(!Obj_IsDeleted(scene)){yield;}
  727. //Post midboss
  728.  
  729. //Boss
  730.  
  731. //Last spell
  732.  
  733. //End
  734. loop{yield;}
  735. ObjSound_Stop(Bgm);
  736. if(practice == true){CloseStgScene;}
  737. stage++;
  738. yield;
  739. }
  740. case(2){
  741. Bgm = PlayMusic("BgmS2.ogg", 0, 0);
  742. //Pre midboss
  743.  
  744. //Midboss
  745.  
  746. //Post midboss
  747.  
  748. //Boss
  749.  
  750. //Last spell
  751.  
  752. //End
  753. ObjSound_Stop(Bgm);
  754. if(practice == true){CloseStgScene;}
  755. stage++;
  756. yield;
  757. }
  758. case(3){
  759. Bgm = PlayMusic("BgmS3.ogg", 0, 0);
  760. //Pre midboss
  761.  
  762. //Midboss
  763.  
  764. //Post midboss
  765.  
  766. //Boss
  767.  
  768. //Last spell
  769.  
  770. //End
  771. ObjSound_Stop(Bgm);
  772. if(practice == true){CloseStgScene;}
  773. stage++;
  774. yield;
  775. }
  776. case(4){
  777. Bgm = PlayMusic("BgmS4.ogg", 0, 0);
  778. //Pre midboss
  779.  
  780. //Midboss
  781.  
  782. //Post midboss
  783.  
  784. //Boss
  785.  
  786. //Last spell
  787.  
  788. //End
  789. ObjSound_Stop(Bgm);
  790. if(practice == true){CloseStgScene;}
  791. stage++;
  792. yield;
  793. }
  794. case(5){
  795. Bgm = PlayMusic("BgmS5.ogg", 0, 0);
  796. //Pre midboss
  797.  
  798. //Midboss
  799.  
  800. //Post midboss
  801.  
  802. //Boss
  803.  
  804. //End
  805. ObjSound_Stop(Bgm);
  806. if(practice == true){CloseStgScene;}
  807. stage++;
  808. yield;
  809. }
  810. case(6){
  811. Bgm = PlayMusic("BgmS6.ogg", 0, 0);
  812. //Pre midboss
  813.  
  814. //Midboss
  815.  
  816. //Boss
  817.  
  818. //Last spell
  819.  
  820. //End
  821. ObjSound_Stop(Bgm);
  822. if(practice == true){CloseStgScene;}
  823. }
  824. case(7){
  825. Bgm = PlayMusic("BgmS7.ogg", 0, 0);
  826. //Stage
  827.  
  828. //Boss
  829.  
  830. //End
  831. ObjSound_Stop(Bgm);
  832. if(practice == true){CloseStgScene;}
  833. }
  834. yield;
  835. }
  836. }
  837. case("EXTRA"){
  838. loop{
  839. alternative(stage)
  840. case(8){
  841. Bgm = PlayMusic("BgmSEx.ogg", 0, 0);
  842. //Pre midboss
  843.  
  844. //Midboss
  845.  
  846. //Post midboss
  847.  
  848. //Boss
  849.  
  850. //Last spell
  851.  
  852. //End
  853.  
  854. }
  855. case(9){
  856. Bgm = PlayMusic("BgmSPh.ogg", 0, 0);
  857. //Pre midboss
  858.  
  859. //Midboss
  860.  
  861. //Post midboss
  862.  
  863. //Boss
  864.  
  865. //Last spell
  866.  
  867. //End
  868.  
  869. }
  870. yield;
  871. }
  872. }
  873. yield;
  874. }
  875. }
  876.  
  877. task RenderBackground{
  878. loop{
  879. while(stage==0){yield;}
  880. let obj = GetEnemyBossSceneObjectID;
  881. if(obj != ID_INVALID){
  882. while(ObjEnemyBossScene_GetInfo(obj, INFO_IS_SPELL)){yield;}
  883. }
  884. alternative(stage)
  885. case(1){
  886. SetCameraElevationAngle(40);
  887. SetCameraAzimuthAngle(90);
  888. SetCameraFocusX(192);
  889. SetCameraFocusY(-128);
  890. SetCameraFocusZ(0);
  891. SetFogParam(1000, 2000, 0, 0, 0);
  892. RenderFloor(192, -400, -200);
  893. RenderFloor(192, -400, -712);
  894. RenderFloor(192, -400, -1224);
  895. RenderFloor(192, -400, -1736);
  896. RenderFloor(192, -400, -2248);
  897. RenderWall(-64, -272, -200, 90);
  898. RenderWall(-64, -272, -712, 90);
  899. RenderWall(-64, -272, -1224, 90);
  900. RenderWall(-64, -272, -1736, 90);
  901. RenderWall(-64, -272, -2248, 90);
  902. RenderWall(444, -272, -200, -90);
  903. RenderWall(444, -272, -712, -90);
  904. RenderWall(444, -272, -1224, -90);
  905. RenderWall(444, -272, -1736, -90);
  906. RenderWall(444, -272, -2248, -90);
  907. while(stage == 1){yield;}
  908. }
  909. case(2){
  910.  
  911. }
  912. case(3){
  913.  
  914. }
  915. case(4){
  916.  
  917. }
  918. case(5){
  919.  
  920. }
  921. case(6){
  922.  
  923. }
  924. case(7){
  925.  
  926. }
  927. case(8){
  928.  
  929. }
  930. yield;
  931. }
  932. }
  933.  
  934. function CreateMenuOption(text, x, y){
  935. let option = ObjText_Create;
  936. ObjRender_SetPosition(option, x, y, 0);
  937. ObjText_SetText(option, text);
  938. Obj_SetRenderPriority(option, 0.91);
  939. ObjText_SetFontBorderColor(option, 1, 1, 1);
  940. ObjText_SetFontBorderWidth(option, 2);
  941. ObjText_SetFontBorderType(option,BORDER_FULL);
  942. return option;
  943. }
  944.  
  945. function CreateSubMenuOption(text, x, y, size){
  946. let option = ObjText_Create;
  947. ObjRender_SetPosition(option, x, y, 0);
  948. ObjText_SetFontSize(option, size);
  949. ObjText_SetText(option, text);
  950. Obj_SetRenderPriority(option, 0.91);
  951. ObjText_SetFontColorBottom(option, 192, 192, 192);
  952. ObjText_SetFontBorderColor(option, 1, 1, 1);
  953. ObjText_SetFontBorderWidth(option, 1);
  954. ObjText_SetFontBorderType(option,BORDER_FULL);
  955. return option;
  956. }
  957.  
  958. task RenderFloor(x, y, z){
  959. let obj = ObjPrim_Create(OBJ_SPRITE_3D);
  960. Obj_SetRenderPriorityI(obj, 20);
  961. ObjRender_SetAngleXYZ(obj, 90, 0, 0);
  962. ObjPrim_SetTexture(obj, FloorImg);
  963. while(stage == 1){
  964. ObjRender_SetPosition(obj, x, y, z);
  965. ObjSprite3D_SetSourceRect(obj, 0, 0, 512, 512);
  966. ObjSprite3D_SetSourceDestRect(obj, 0, 0, 512, 512);
  967. z+=8;
  968. if(z>=824){
  969. z = -1736;
  970. }
  971. yield;
  972. }
  973. }
  974.  
  975. task RenderWall(x, y, z, a){
  976. let obj = ObjPrim_Create(OBJ_SPRITE_3D);
  977. Obj_SetRenderPriorityI(obj, 20);
  978. ObjRender_SetAngleXYZ(obj, 0, a, -90);
  979. ObjPrim_SetTexture(obj, WallImg);
  980. while(stage == 1){
  981. ObjRender_SetPosition(obj, x, y, z);
  982. ObjSprite3D_SetSourceRect(obj, 0, 0, 512, 512);
  983. ObjSprite3D_SetSourceDestRect(obj, 0, 0, 512, 512);
  984. z+=8;
  985. if(z>=824){
  986. z = -1736;
  987. }
  988. yield;
  989. }
  990. }
  991.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement