Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #TouhouDanmakufu[Stage]
- #ScriptVersion[3]
- #Title["Ancient Legend Resurrection"]
- #System["./system/System.dnh"]
- #Player["script/player/youkaihunters/YoukaiHunters.txt"]
- #include "./system/StageFunctions.dnh"
- #include "./enemy/st1enm.dnh"
- #include "./enemy/st2enm.dnh"
- #include "./enemy/st3enm.dnh"
- #include "./enemy/st4enm.dnh"
- #include "./enemy/st5enm.dnh"
- #include "./enemy/st6enm.dnh"
- #include "./enemy/stEXenm.dnh"
- #include "./enemy/stPHenm.dnh"
- let phase = "MENU";
- let difficultySelectType;
- let difficulty;
- let stage = 0;
- let practice = false;
- let menu = ObjPrim_Create(OBJ_SPRITE_2D);
- let menuImg = img_system ~ "Menu.png";
- let subImg = img_system ~ "Submenu.png";
- let menuCursor = 0;
- let subCursor = 0;
- let chosenSong = 0;
- let Bgm;
- let scene;
- //let timer = 0;
- @Initialize{
- LoadSoundEffects;
- LoadTextures;
- RenderBackground;
- MainTask;
- }
- @MainLoop{
- yield;
- }
- task MainTask
- {
- loop{
- alternative(phase)
- case("MENU"){
- Bgm = PlayMusic("BgmTitle.ogg",0,0);
- SetForbidPlayerShot(true);
- SetForbidPlayerSpell(true);
- ObjPrim_SetTexture(menu, menuImg);
- Obj_SetRenderPriority(menu, 0.9);
- ObjSprite2D_SetSourceRect(menu, 0, 0, 640, 480);
- ObjSprite2D_SetDestRect(menu, 0, 0, 640, 480);
- let startOption = CreateMenuOption("Game Start", 434, 150);
- let extraOption = CreateMenuOption("Extra Start", 434, 176);
- let practiceOption = CreateMenuOption("Practice Start", 434, 202);
- let spellOption = CreateMenuOption("Spell Practice", 434, 228);
- let musicOption = CreateMenuOption("Music Room", 434, 254);
- while(phase=="MENU"){
- if(menuCursor==0){
- ObjText_SetFontColorTop(startOption, 255, 255, 255);
- ObjText_SetFontColorBottom(startOption, 255, 128, 0);
- }else{
- ObjText_SetFontColorTop(startOption, 255, 255, 255);
- ObjText_SetFontColorBottom(startOption, 128, 64, 0);
- }
- if(menuCursor==1){
- ObjText_SetFontColorTop(extraOption, 255, 255, 255);
- ObjText_SetFontColorBottom(extraOption, 255, 128, 0);
- }else{
- ObjText_SetFontColorTop(extraOption, 255, 255, 255);
- ObjText_SetFontColorBottom(extraOption, 128, 64, 0);
- }
- if(menuCursor==2){
- ObjText_SetFontColorTop(practiceOption, 255, 255, 255);
- ObjText_SetFontColorBottom(practiceOption, 255, 128, 0);
- }else{
- ObjText_SetFontColorTop(practiceOption, 255, 255, 255);
- ObjText_SetFontColorBottom(practiceOption, 128, 64, 0);
- }
- if(menuCursor==3){
- ObjText_SetFontColorTop(spellOption, 255, 255, 255);
- ObjText_SetFontColorBottom(spellOption, 255, 128, 0);
- }else{
- ObjText_SetFontColorTop(spellOption, 255, 255, 255);
- ObjText_SetFontColorBottom(spellOption, 128, 64, 0);
- }
- if(menuCursor==4){
- ObjText_SetFontColorTop(musicOption, 255, 255, 255);
- ObjText_SetFontColorBottom(musicOption, 255, 128, 0);
- }else{
- ObjText_SetFontColorTop(musicOption, 255, 255, 255);
- ObjText_SetFontColorBottom(musicOption, 128, 64, 0);
- }
- if(GetVirtualKeyState(VK_DOWN)==KEY_PUSH){
- menuCursor++;
- PlaySE(Select);
- if(menuCursor>4){
- menuCursor = 0;
- }
- }else if(GetVirtualKeyState(VK_UP)==KEY_PUSH){
- menuCursor--;
- PlaySE(Select);
- if(menuCursor<0){
- menuCursor = 4;
- }
- }
- if(GetVirtualKeyState(VK_SHOT)==KEY_PUSH){
- PlaySE(SelectOk);
- alternative(menuCursor)
- case(0){
- phase = "DIFFICULTY";
- difficultySelectType = "GAME";
- }
- case(1){
- phase = "DIFFICULTY";
- difficultySelectType = "EXTRA";
- }
- case(2){
- phase = "DIFFICULTY";
- difficultySelectType = "PRACTICE";
- }
- case(3){
- phase = "SPRACTICE";
- }
- case(4){
- phase = "MUSIC";
- }
- Obj_Delete(startOption);
- Obj_Delete(extraOption);
- Obj_Delete(practiceOption);
- Obj_Delete(spellOption);
- Obj_Delete(musicOption);
- }
- yield;
- }
- }
- case("DIFFICULTY"){
- subCursor = 0;
- ObjPrim_SetTexture(menu, subImg);
- Obj_SetRenderPriority(menu, 0.91);
- ObjSprite2D_SetSourceRect(menu, 0, 0, 640, 480);
- ObjSprite2D_SetDestRect(menu, 0, 0, 640, 480);
- let easyOpt;
- let normalOpt;
- let hardOpt;
- let lunaticOpt;
- let extraOpt;
- let phantasmOpt;
- if(difficultySelectType != "EXTRA"){
- easyOpt = CreateSubMenuOption("EASY", 0, 108, 48);
- normalOpt = CreateSubMenuOption("NORMAL", 0, 180, 48);
- hardOpt = CreateSubMenuOption("HARD", 0, 252, 48);
- lunaticOpt = CreateSubMenuOption("LUNATIC", 0, 324, 48);
- ObjText_SetMaxWidth(easyOpt, 640);
- ObjText_SetHorizontalAlignment(easyOpt, ALIGNMENT_CENTER);
- ObjText_SetMaxWidth(normalOpt, 640);
- ObjText_SetHorizontalAlignment(normalOpt, ALIGNMENT_CENTER);
- ObjText_SetMaxWidth(hardOpt, 640);
- ObjText_SetHorizontalAlignment(hardOpt, ALIGNMENT_CENTER);
- ObjText_SetMaxWidth(lunaticOpt, 640);
- ObjText_SetHorizontalAlignment(lunaticOpt, ALIGNMENT_CENTER);
- }else{
- extraOpt = CreateSubMenuOption("EXTRA", 0, 180, 48);
- phantasmOpt = CreateSubMenuOption("PHANTASM", 0, 252, 48);
- ObjText_SetMaxWidth(extraOpt, 640);
- ObjText_SetHorizontalAlignment(extraOpt, ALIGNMENT_CENTER);
- ObjText_SetMaxWidth(phantasmOpt, 640);
- ObjText_SetHorizontalAlignment(phantasmOpt, ALIGNMENT_CENTER);
- }
- while(phase=="DIFFICULTY"){
- if(difficultySelectType != "EXTRA"){
- if(subCursor==0){
- ObjText_SetFontColorTop(easyOpt, 255, 255, 255);
- ObjText_SetFontColorBottom(easyOpt, 0, 255, 0);
- }else{
- ObjText_SetFontColorTop(easyOpt, 0, 255, 0);
- ObjText_SetFontColorBottom(easyOpt, 0, 128, 0);
- }
- if(subCursor==1){
- ObjText_SetFontColorTop(normalOpt, 255, 255, 255);
- ObjText_SetFontColorBottom(normalOpt, 255, 255, 0);
- }else{
- ObjText_SetFontColorTop(normalOpt, 255, 255, 0);
- ObjText_SetFontColorBottom(normalOpt, 128, 128, 0);
- }
- if(subCursor==2){
- ObjText_SetFontColorTop(hardOpt, 255, 255, 255);
- ObjText_SetFontColorBottom(hardOpt, 255, 128, 0);
- }else{
- ObjText_SetFontColorTop(hardOpt, 255, 128, 0);
- ObjText_SetFontColorBottom(hardOpt, 128, 64, 0);
- }
- if(subCursor==3){
- ObjText_SetFontColorTop(lunaticOpt, 255, 255, 255);
- ObjText_SetFontColorBottom(lunaticOpt, 255, 0, 0);
- }else{
- ObjText_SetFontColorTop(lunaticOpt, 255, 0, 0);
- ObjText_SetFontColorBottom(lunaticOpt, 128, 0, 0);
- }
- if(GetVirtualKeyState(VK_DOWN)==KEY_PUSH){
- subCursor++;
- PlaySE(Select);
- if(subCursor>3){
- subCursor = 0;
- }
- }else if(GetVirtualKeyState(VK_UP)==KEY_PUSH){
- subCursor--;
- PlaySE(Select);
- if(subCursor<0){
- subCursor = 3;
- }
- }
- }else{
- if(subCursor==0){
- ObjText_SetFontColorTop(extraOpt, 255, 255, 255);
- ObjText_SetFontColorBottom(extraOpt, 0, 0, 255);
- }else{
- ObjText_SetFontColorTop(extraOpt, 0, 0, 255);
- ObjText_SetFontColorBottom(extraOpt, 0, 0, 128);
- }
- if(subCursor==1){
- ObjText_SetFontColorTop(phantasmOpt, 255, 255, 255);
- ObjText_SetFontColorBottom(phantasmOpt, 255, 0, 255);
- }else{
- ObjText_SetFontColorTop(phantasmOpt, 255, 0, 255);
- ObjText_SetFontColorBottom(phantasmOpt, 128, 0, 128);
- }
- if(GetVirtualKeyState(VK_DOWN)==KEY_PUSH){
- subCursor++;
- PlaySE(Select);
- if(subCursor>1){
- subCursor = 0;
- }
- }else if(GetVirtualKeyState(VK_UP)==KEY_PUSH){
- subCursor--;
- PlaySE(Select);
- if(subCursor<0){
- subCursor = 1;
- }
- }
- }
- if(GetVirtualKeyState(VK_SHOT)==KEY_PUSH){
- PlaySE(SelectOk);
- SetDif(subCursor+1);
- phase = difficultySelectType;
- if(phase == "GAME"){
- ObjSound_Stop(Bgm);
- Obj_Delete(menu);
- Obj_Delete(easyOpt);
- Obj_Delete(normalOpt);
- Obj_Delete(hardOpt);
- Obj_Delete(lunaticOpt);
- SetForbidPlayerShot(false);
- SetForbidPlayerSpell(false);
- stage = 1;
- }else if(phase == "EXTRA"){
- ObjSound_Stop(Bgm);
- Obj_Delete(menu);
- Obj_Delete(extraOpt);
- Obj_Delete(phantasmOpt);
- SetForbidPlayerShot(false);
- SetForbidPlayerSpell(false);
- stage = subCursor + 8;
- }else{
- Obj_Delete(easyOpt);
- Obj_Delete(normalOpt);
- Obj_Delete(hardOpt);
- Obj_Delete(lunaticOpt);
- }
- }
- if(GetVirtualKeyState(VK_SPELL)==KEY_PUSH){
- PlaySE(SelectCancel);
- phase = "MENU";
- if(difficultySelectType != "EXTRA"){
- Obj_Delete(easyOpt);
- Obj_Delete(normalOpt);
- Obj_Delete(hardOpt);
- Obj_Delete(lunaticOpt);
- }else{
- Obj_Delete(extraOpt);
- Obj_Delete(phantasmOpt);
- }
- }
- yield;
- }
- }
- case("PRACTICE"){
- subCursor = 0;
- let s1Opt = CreateSubMenuOption("STAGE 1", 0, 36, 48);
- let s2Opt = CreateSubMenuOption("STAGE 2", 0, 96, 48);
- let s3Opt = CreateSubMenuOption("STAGE 3", 0, 156, 48);
- let s4Opt = CreateSubMenuOption("STAGE 4", 0, 216, 48);
- let s5Opt = CreateSubMenuOption("STAGE 5", 0, 276, 48);
- let s6Opt = CreateSubMenuOption("STAGE 6", 0, 336, 48);
- let s7Opt = CreateSubMenuOption("STAGE 7", 0, 396, 48);
- ObjText_SetMaxWidth(s1Opt, 640);
- ObjText_SetHorizontalAlignment(s1Opt, ALIGNMENT_CENTER);
- ObjText_SetMaxWidth(s2Opt, 640);
- ObjText_SetHorizontalAlignment(s2Opt, ALIGNMENT_CENTER);
- ObjText_SetMaxWidth(s3Opt, 640);
- ObjText_SetHorizontalAlignment(s3Opt, ALIGNMENT_CENTER);
- ObjText_SetMaxWidth(s4Opt, 640);
- ObjText_SetHorizontalAlignment(s4Opt, ALIGNMENT_CENTER);
- ObjText_SetMaxWidth(s5Opt, 640);
- ObjText_SetHorizontalAlignment(s5Opt, ALIGNMENT_CENTER);
- ObjText_SetMaxWidth(s6Opt, 640);
- ObjText_SetHorizontalAlignment(s6Opt, ALIGNMENT_CENTER);
- ObjText_SetMaxWidth(s7Opt, 640);
- ObjText_SetHorizontalAlignment(s7Opt, ALIGNMENT_CENTER);
- while(phase == "PRACTICE"){
- if(subCursor==0){
- ObjText_SetFontColorTop(s1Opt, 255, 255, 255);
- ObjText_SetFontColorBottom(s1Opt, 128, 128, 128);
- }else{
- ObjText_SetFontColorTop(s1Opt, 128, 128, 128);
- ObjText_SetFontColorBottom(s1Opt, 64, 64, 64);
- }
- if(subCursor==1){
- ObjText_SetFontColorTop(s2Opt, 255, 255, 255);
- ObjText_SetFontColorBottom(s2Opt, 128, 128, 128);
- }else{
- ObjText_SetFontColorTop(s2Opt, 128, 128, 128);
- ObjText_SetFontColorBottom(s2Opt, 64, 64, 64);
- }
- if(subCursor==2){
- ObjText_SetFontColorTop(s3Opt, 255, 255, 255);
- ObjText_SetFontColorBottom(s3Opt, 128, 128, 128);
- }else{
- ObjText_SetFontColorTop(s3Opt, 128, 128, 128);
- ObjText_SetFontColorBottom(s3Opt, 64, 64, 64);
- }
- if(subCursor==3){
- ObjText_SetFontColorTop(s4Opt, 255, 255, 255);
- ObjText_SetFontColorBottom(s4Opt, 128, 128, 128);
- }else{
- ObjText_SetFontColorTop(s4Opt, 128, 128, 128);
- ObjText_SetFontColorBottom(s4Opt, 64, 64, 64);
- }
- if(subCursor==4){
- ObjText_SetFontColorTop(s5Opt, 255, 255, 255);
- ObjText_SetFontColorBottom(s5Opt, 128, 128, 128);
- }else{
- ObjText_SetFontColorTop(s5Opt, 128, 128, 128);
- ObjText_SetFontColorBottom(s5Opt, 64, 64, 64);
- }
- if(subCursor==5){
- ObjText_SetFontColorTop(s6Opt, 255, 255, 255);
- ObjText_SetFontColorBottom(s6Opt, 128, 128, 128);
- }else{
- ObjText_SetFontColorTop(s6Opt, 128, 128, 128);
- ObjText_SetFontColorBottom(s6Opt, 64, 64, 64);
- }
- if(subCursor==6){
- ObjText_SetFontColorTop(s7Opt, 255, 255, 255);
- ObjText_SetFontColorBottom(s7Opt, 128, 128, 128);
- }else{
- ObjText_SetFontColorTop(s7Opt, 128, 128, 128);
- ObjText_SetFontColorBottom(s7Opt, 64, 64, 64);
- }
- if(GetVirtualKeyState(VK_DOWN)==KEY_PUSH){
- subCursor++;
- PlaySE(Select);
- if(subCursor>6){
- subCursor = 0;
- }
- }else if(GetVirtualKeyState(VK_UP)==KEY_PUSH){
- subCursor--;
- PlaySE(Select);
- if(subCursor<0){
- subCursor = 6;
- }
- }
- if(GetVirtualKeyState(VK_SHOT)==KEY_PUSH){
- phase = "GAME";
- PlaySE(SelectOk);
- ObjSound_Stop(Bgm);
- SetPlayerLife(10);
- practice = true;
- Obj_Delete(menu);
- Obj_Delete(s1Opt);
- Obj_Delete(s2Opt);
- Obj_Delete(s3Opt);
- Obj_Delete(s4Opt);
- Obj_Delete(s5Opt);
- Obj_Delete(s6Opt);
- Obj_Delete(s7Opt);
- SetForbidPlayerShot(false);
- SetForbidPlayerSpell(false);
- stage = subCursor + 1;
- }
- if(GetVirtualKeyState(VK_SPELL)==KEY_PUSH){
- PlaySE(SelectCancel);
- phase = "MENU";
- Obj_Delete(s1Opt);
- Obj_Delete(s2Opt);
- Obj_Delete(s3Opt);
- Obj_Delete(s4Opt);
- Obj_Delete(s5Opt);
- Obj_Delete(s6Opt);
- Obj_Delete(s7Opt);
- }
- yield;
- }
- }
- case("MUSIC"){
- subCursor = 0;
- chosenSong = 0;
- ObjPrim_SetTexture(menu, subImg);
- Obj_SetRenderPriority(menu, 0.91);
- ObjSprite2D_SetSourceRect(menu, 0, 0, 640, 480);
- ObjSprite2D_SetDestRect(menu, 0, 0, 640, 480);
- let musicName = CreateSubMenuOption("Cosmo Ruin", 0, 12, 24);
- let musicComment = CreateSubMenuOption("The title theme.", 0, 36, 24);
- let themeOpt = CreateSubMenuOption("1.Cosmo Ruin", 0, 226, 28);
- ObjText_SetMaxWidth(musicName, 640);
- ObjText_SetHorizontalAlignment(musicName, ALIGNMENT_CENTER);
- ObjText_SetMaxWidth(musicComment, 640);
- ObjText_SetHorizontalAlignment(musicComment, ALIGNMENT_CENTER);
- ObjText_SetMaxWidth(themeOpt, 640);
- ObjText_SetHorizontalAlignment(themeOpt, ALIGNMENT_CENTER);
- //let debug = ObjText_Create;
- //Obj_SetRenderPriority(debug, 0.91);
- while(phase=="MUSIC"){
- alternative(subCursor)
- case(0){
- ObjText_SetText(themeOpt, "1.Cosmo Ruin");
- }
- case(1){
- ObjText_SetText(themeOpt, "2.Paradigm Shift");
- }
- case(2){
- ObjText_SetText(themeOpt, "3.Crown of the Exposed Road ~ Evening Race");
- }
- case(3){
- ObjText_SetText(themeOpt, "4.Other Side of the Miracle");
- }
- case(4){
- ObjText_SetText(themeOpt, "5.Mirror Flower ~ Fantasy of Natural");
- }
- case(5){
- ObjText_SetText(themeOpt, "6.Sleeping in the Abyss ~ Endless Night");
- }
- case(6){
- ObjText_SetText(themeOpt, "7.World Deterioration ~ Field Collapse");
- }
- case(7){
- ObjText_SetText(themeOpt, "8.Rough Poem ~ Forgotten History");
- }
- case(8){
- ObjText_SetText(themeOpt, "9.Transmigration of Dissociation");
- }
- case(9){
- ObjText_SetText(themeOpt, "10.Midnight Fantasy Road ~ Lit Up Way");
- }
- case(10){
- ObjText_SetText(themeOpt, "11.Fantasia Reform ~ Before After");
- }
- case(11){
- ObjText_SetText(themeOpt, "12.Starlight Temple");
- }
- case(12){
- ObjText_SetText(themeOpt, "13.Rumble Temple");
- }
- case(13){
- ObjText_SetText(themeOpt, "14.Hydra's Fantasy ~ Novum Organum");
- }
- case(14){
- ObjText_SetText(themeOpt, "15.New Testament ~ Sol Eater");
- }
- case(15){
- ObjText_SetText(themeOpt, "16.In the End of the World Devastated");
- }
- case(16){
- ObjText_SetText(themeOpt, "17.Beginning of Zero ~ Miracle Side");
- }
- case(17){
- ObjText_SetText(themeOpt, "18.Invitation to the Crimson Star");
- }
- case(18){
- ObjText_SetText(themeOpt, "19.Carnival Syndrome");
- }
- case(19){
- ObjText_SetText(themeOpt, "20.Panic Grave");
- }
- case(20){
- ObjText_SetText(themeOpt, "21.Bell of the Night Sky ~ Quiet Time");
- }
- case(21){
- ObjText_SetText(themeOpt, "22.Tour to the Silhouette Stand ~ Overnight Dream");
- }
- case(22){
- ObjText_SetText(themeOpt, "23.Visited by God's Blessing ~ Forsaken Lamb");
- }
- alternative(chosenSong)
- case(0){
- ObjText_SetText(musicName, "Cosmo Ruin");
- ObjText_SetText(musicComment, "The title theme.");
- }
- case(1){
- ObjText_SetText(musicName, "Paradigm Shift");
- ObjText_SetText(musicComment, "The first stage theme.");
- }
- case(2){
- ObjText_SetText(musicName, "Crown of the Exposed Road ~ Evening Race");
- ObjText_SetText(musicComment, "Yukari Yakumo's theme.");
- }
- case(3){
- ObjText_SetText(musicName, "Other Side of the Miracle");
- ObjText_SetText(musicComment, "The second stage theme.");
- }
- case(4){
- ObjText_SetText(musicName, "Mirror Flower ~ Fantasy of Natural");
- ObjText_SetText(musicComment, "Kakiyuri Hanabatake's theme.");
- }
- case(5){
- ObjText_SetText(musicName, "Sleeping in the Abyss ~ Endless Night");
- ObjText_SetText(musicComment, "The third stage theme.");
- }
- case(6){
- ObjText_SetText(musicName, "World Deterioration ~ Field Collapse");
- ObjText_SetText(musicComment, "Kuraimori Chiyoru's theme.");
- }
- case(7){
- ObjText_SetText(musicName, "Rough Poem ~ Forgotten History");
- ObjText_SetText(musicComment, "The fourth stage theme.");
- }
- case(8){
- ObjText_SetText(musicName, "Transmigration of Dissociation");
- ObjText_SetText(musicComment, "Kiriwaru Monsorasu's theme.");
- }
- case(9){
- ObjText_SetText(musicName, "Midnight Fantasy Road ~ Lit Up Way");
- ObjText_SetText(musicComment, "The fifth stage theme.");
- }
- case(10){
- ObjText_SetText(musicName, "Fantasia Reform ~ Before After");
- ObjText_SetText(musicComment, "Kamirei Shuhaiwa's theme.");
- }
- case(11){
- ObjText_SetText(musicName, "Starlight Temple");
- ObjText_SetText(musicComment, "The sixth stage theme.");
- }
- case(12){
- ObjText_SetText(musicName, "Rumble Temple");
- ObjText_SetText(musicComment, "Suisho Azayaka's theme.");
- }
- case(13){
- ObjText_SetText(musicName, "Hydra's Fantasy ~ Novum Organum");
- ObjText_SetText(musicComment, "The last spell theme.");
- }
- case(14){
- ObjText_SetText(musicName, "New Testament ~ Sol Eater");
- ObjText_SetText(musicComment, "The seventh stage theme.");
- }
- case(15){
- ObjText_SetText(musicName, "In the End of the World Devastated");
- ObjText_SetText(musicComment, "Hakaishi Kaimetsu's theme.");
- }
- case(16){
- ObjText_SetText(musicName, "Beginning of Zero ~ Miracle Side");
- ObjText_SetText(musicComment, "The extra stage theme.");
- }
- case(17){
- ObjText_SetText(musicName, "Invitation to the Crimson Star");
- ObjText_SetText(musicComment, "Aotsuki Chiyoru's theme.");
- }
- case(18){
- ObjText_SetText(musicName, "Carnival Syndrome");
- ObjText_SetText(musicComment, "The phantasm stage theme.");
- }
- case(19){
- ObjText_SetText(musicName, "Panic Grave");
- ObjText_SetText(musicComment, "Ryuho Kodaishohi's theme.");
- }
- case(20){
- ObjText_SetText(musicName, "Bell of the Night Sky ~ Quiet Time");
- ObjText_SetText(musicComment, "The ending theme.");
- }
- case(21){
- ObjText_SetText(musicName, "Tour to the Silhouette Stand ~ Overnight Dream");
- ObjText_SetText(musicComment, "The credits theme.");
- }
- case(22){
- ObjText_SetText(musicName, "Visited by God's Blessing ~ Forsaken Lamb");
- ObjText_SetText(musicComment, "The last word theme.");
- }
- if(GetVirtualKeyState(VK_RIGHT)==KEY_PUSH){
- subCursor++;
- PlaySE(Select);
- if(subCursor>22){
- subCursor = 0;
- }
- }else if(GetVirtualKeyState(VK_LEFT)==KEY_PUSH){
- subCursor--;
- PlaySE(Select);
- if(subCursor<0){
- subCursor = 22;
- }
- }
- if(GetVirtualKeyState(VK_DOWN)==KEY_PUSH){
- subCursor++;
- PlaySE(Select);
- if(subCursor>22){
- subCursor = 0;
- }
- }else if(GetVirtualKeyState(VK_UP)==KEY_PUSH){
- subCursor--;
- PlaySE(Select);
- if(subCursor<0){
- subCursor = 22;
- }
- }
- if(GetVirtualKeyState(VK_SHOT)==KEY_PUSH){
- chosenSong = subCursor;
- ObjSound_Stop(Bgm);
- //timer = 0;
- yield;
- alternative(subCursor)
- case(0){
- Bgm = PlayMusic("BgmTitle.ogg", 0, 0);
- }
- case(1){
- Bgm = PlayMusic("BgmS1.ogg", 0, 0);
- }
- case(2){
- Bgm = PlayMusic("BgmYukari.ogg", 0.9, 94.9);
- }
- case(3){
- Bgm = PlayMusic("BgmS2.ogg", 0, 0);
- }
- case(4){
- Bgm = PlayMusic("BgmKakiyuri.ogg", 9.24, 181);
- }
- case(5){
- Bgm = PlayMusic("BgmS3.ogg", 0, 0);
- }
- case(6){
- Bgm = PlayMusic("BgmKuraimori.ogg", 10.95, 188.3);
- }
- case(7){
- Bgm = PlayMusic("BgmS4.ogg", 0, 0);
- }
- case(8){
- Bgm = PlayMusic("BgmKiriwaru.ogg", 0, 0);
- }
- case(9){
- Bgm = PlayMusic("BgmS5.ogg", 0, 0);
- }
- case(10){
- Bgm = PlayMusic("BgmKamirei.ogg", 0, 0);
- }
- case(11){
- Bgm = PlayMusic("BgmS6.ogg", 0, 0);
- }
- case(12){
- Bgm = PlayMusic("BgmSuisho.ogg", 0, 0);
- }
- case(13){
- Bgm = PlayMusic("BgmLS.ogg", 0, 0);
- }
- case(14){
- Bgm = PlayMusic("BgmS7.ogg", 0, 0);
- }
- case(15){
- Bgm = PlayMusic("BgmHakaishi.ogg", 0, 0);
- }
- case(16){
- Bgm = PlayMusic("BgmSEx.ogg", 0, 0);
- }
- case(17){
- Bgm = PlayMusic("BgmAotsuki.ogg", 0, 0);
- }
- case(18){
- Bgm = PlayMusic("BgmSPh.ogg", 0, 0);
- }
- case(19){
- Bgm = PlayMusic("BgmRyuho.ogg", 0, 0);
- }
- case(20){
- Bgm = PlayMusic("BgmEnd.ogg", 0, 0);
- }
- case(21){
- Bgm = PlayMusic("BgmCredits.ogg", 0, 0);
- }
- case(22){
- Bgm = PlayMusic("BgmLW.ogg", 0, 0);
- }
- }
- if(GetVirtualKeyState(VK_SPELL)==KEY_PUSH){
- PlaySE(SelectCancel);
- phase = "MENU";
- Obj_Delete(musicName);
- Obj_Delete(musicComment);
- Obj_Delete(themeOpt);
- ObjSound_Stop(Bgm);
- }
- if(subCursor==chosenSong){
- ObjText_SetFontColorTop(themeOpt, 255, 255, 255);
- ObjText_SetFontColorBottom(themeOpt, 255, 255, 0);
- }else{
- ObjText_SetFontColorTop(themeOpt, 128, 128, 128);
- ObjText_SetFontColorBottom(themeOpt, 64, 64, 64);
- }
- //timer+=1/60;
- //ObjText_SetText(debug, timer);
- yield;
- }
- }
- case("GAME"){
- loop{
- alternative(stage)
- case(1){
- Bgm = PlayMusic("BgmS1.ogg", 0, 0);
- //Pre midboss
- TWait(180);
- //Midboss
- scene = ObjEnemyBossScene_Create();
- ObjEnemyBossScene_Add(scene, 0, "./boss/RanN1.dnh");
- if(GetDif>2){
- //ObjEnemyBossScene_Add(scene, 0, "./boss/RanS1.dnh");
- }
- ObjEnemyBossScene_LoadInThread(scene);
- ObjEnemyBossScene_Regist(scene);
- while(!Obj_IsDeleted(scene)){yield;}
- //Post midboss
- //Boss
- //Last spell
- //End
- loop{yield;}
- ObjSound_Stop(Bgm);
- if(practice == true){CloseStgScene;}
- stage++;
- yield;
- }
- case(2){
- Bgm = PlayMusic("BgmS2.ogg", 0, 0);
- //Pre midboss
- //Midboss
- //Post midboss
- //Boss
- //Last spell
- //End
- ObjSound_Stop(Bgm);
- if(practice == true){CloseStgScene;}
- stage++;
- yield;
- }
- case(3){
- Bgm = PlayMusic("BgmS3.ogg", 0, 0);
- //Pre midboss
- //Midboss
- //Post midboss
- //Boss
- //Last spell
- //End
- ObjSound_Stop(Bgm);
- if(practice == true){CloseStgScene;}
- stage++;
- yield;
- }
- case(4){
- Bgm = PlayMusic("BgmS4.ogg", 0, 0);
- //Pre midboss
- //Midboss
- //Post midboss
- //Boss
- //Last spell
- //End
- ObjSound_Stop(Bgm);
- if(practice == true){CloseStgScene;}
- stage++;
- yield;
- }
- case(5){
- Bgm = PlayMusic("BgmS5.ogg", 0, 0);
- //Pre midboss
- //Midboss
- //Post midboss
- //Boss
- //End
- ObjSound_Stop(Bgm);
- if(practice == true){CloseStgScene;}
- stage++;
- yield;
- }
- case(6){
- Bgm = PlayMusic("BgmS6.ogg", 0, 0);
- //Pre midboss
- //Midboss
- //Boss
- //Last spell
- //End
- ObjSound_Stop(Bgm);
- if(practice == true){CloseStgScene;}
- }
- case(7){
- Bgm = PlayMusic("BgmS7.ogg", 0, 0);
- //Stage
- //Boss
- //End
- ObjSound_Stop(Bgm);
- if(practice == true){CloseStgScene;}
- }
- yield;
- }
- }
- case("EXTRA"){
- loop{
- alternative(stage)
- case(8){
- Bgm = PlayMusic("BgmSEx.ogg", 0, 0);
- //Pre midboss
- //Midboss
- //Post midboss
- //Boss
- //Last spell
- //End
- }
- case(9){
- Bgm = PlayMusic("BgmSPh.ogg", 0, 0);
- //Pre midboss
- //Midboss
- //Post midboss
- //Boss
- //Last spell
- //End
- }
- yield;
- }
- }
- yield;
- }
- }
- task RenderBackground{
- loop{
- while(stage==0){yield;}
- let obj = GetEnemyBossSceneObjectID;
- if(obj != ID_INVALID){
- while(ObjEnemyBossScene_GetInfo(obj, INFO_IS_SPELL)){yield;}
- }
- alternative(stage)
- case(1){
- SetCameraElevationAngle(40);
- SetCameraAzimuthAngle(90);
- SetCameraFocusX(192);
- SetCameraFocusY(-128);
- SetCameraFocusZ(0);
- SetFogParam(1000, 2000, 0, 0, 0);
- RenderFloor(192, -400, -200);
- RenderFloor(192, -400, -712);
- RenderFloor(192, -400, -1224);
- RenderFloor(192, -400, -1736);
- RenderFloor(192, -400, -2248);
- RenderWall(-64, -272, -200, 90);
- RenderWall(-64, -272, -712, 90);
- RenderWall(-64, -272, -1224, 90);
- RenderWall(-64, -272, -1736, 90);
- RenderWall(-64, -272, -2248, 90);
- RenderWall(444, -272, -200, -90);
- RenderWall(444, -272, -712, -90);
- RenderWall(444, -272, -1224, -90);
- RenderWall(444, -272, -1736, -90);
- RenderWall(444, -272, -2248, -90);
- while(stage == 1){yield;}
- }
- case(2){
- }
- case(3){
- }
- case(4){
- }
- case(5){
- }
- case(6){
- }
- case(7){
- }
- case(8){
- }
- yield;
- }
- }
- function CreateMenuOption(text, x, y){
- let option = ObjText_Create;
- ObjRender_SetPosition(option, x, y, 0);
- ObjText_SetText(option, text);
- Obj_SetRenderPriority(option, 0.91);
- ObjText_SetFontBorderColor(option, 1, 1, 1);
- ObjText_SetFontBorderWidth(option, 2);
- ObjText_SetFontBorderType(option,BORDER_FULL);
- return option;
- }
- function CreateSubMenuOption(text, x, y, size){
- let option = ObjText_Create;
- ObjRender_SetPosition(option, x, y, 0);
- ObjText_SetFontSize(option, size);
- ObjText_SetText(option, text);
- Obj_SetRenderPriority(option, 0.91);
- ObjText_SetFontColorBottom(option, 192, 192, 192);
- ObjText_SetFontBorderColor(option, 1, 1, 1);
- ObjText_SetFontBorderWidth(option, 1);
- ObjText_SetFontBorderType(option,BORDER_FULL);
- return option;
- }
- task RenderFloor(x, y, z){
- let obj = ObjPrim_Create(OBJ_SPRITE_3D);
- Obj_SetRenderPriorityI(obj, 20);
- ObjRender_SetAngleXYZ(obj, 90, 0, 0);
- ObjPrim_SetTexture(obj, FloorImg);
- while(stage == 1){
- ObjRender_SetPosition(obj, x, y, z);
- ObjSprite3D_SetSourceRect(obj, 0, 0, 512, 512);
- ObjSprite3D_SetSourceDestRect(obj, 0, 0, 512, 512);
- z+=8;
- if(z>=824){
- z = -1736;
- }
- yield;
- }
- }
- task RenderWall(x, y, z, a){
- let obj = ObjPrim_Create(OBJ_SPRITE_3D);
- Obj_SetRenderPriorityI(obj, 20);
- ObjRender_SetAngleXYZ(obj, 0, a, -90);
- ObjPrim_SetTexture(obj, WallImg);
- while(stage == 1){
- ObjRender_SetPosition(obj, x, y, z);
- ObjSprite3D_SetSourceRect(obj, 0, 0, 512, 512);
- ObjSprite3D_SetSourceDestRect(obj, 0, 0, 512, 512);
- z+=8;
- if(z>=824){
- z = -1736;
- }
- yield;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement