let freeBattleMenuY=0;function freeBattle(){if(bgmSwitch===BGM_OFF){bgmSwitch=BGM_ON;playBgm(Sounds.BGM_TITLE);backScene=BS_FREE} drawImgS(Graphs.BG_MENU,0,0,DISPLAY_SIZE_X,DISPLAY_SIZE_Y);setAlp(50);drawImgS(Graphs.W_BG,0,0,DISPLAY_SIZE_X,DISPLAY_SIZE_Y);setAlp(100);fText("【フリーバトルモード】",500,45,25,colorRGB(255,255,128));let text=["パーティ編成","装備 & Lv変更","ステータス","難易度選択","キー設定・その他","敵選択 & 戦闘開始"];freeBattleMenuY=selectMenuY(freeBattleMenuY,6);let color;for(let num=0;num<text.length;num++){if(num===freeBattleMenuY){color=colorRGB(255,64,64)}else{color=colorRGB(255,255,255)} fText(text[num],115,50+35*num,25,color)} if(key[32]===1||key[13]===1){key[32]=2;key[13]=2;backScene=BS_FREE;switch(freeBattleMenuY){case 0:gameScene=SCENE_SET_PARTY;initSetParty();for(let num=0;num<CHARA_NUM_MAX;num++){{charaHp[num]=charaMaxHp[num];charaState[num]=P_STATE_NOMAL}} break;case 1:gameScene=SCENE_EQUIPMENT;break;case 2:gameScene=SCENE_STATES;break;case 3:gameScene=SCENE_DIFFICULTY;break;case 4:gameScene=SCENE_KEYCONFIG;break;case 5:if(charaPosition[0]===CHARA_WAIT&&charaPosition[1]===CHARA_WAIT&&charaPosition[2]===CHARA_WAIT){playSE(Sounds.SE_ESC)}else{gameScene=SCENE_SELECT_ENEMY} break} playSE(Sounds.SE_SPACE)} if(key[27]===1){key[27]=2;playSE(Sounds.SE_ESC);stopBgm();bgmSwitch=BGM_OFF;gameScene=SCENE_TITLE;backScene=BS_TITLE} drawImg(Graphs.KEY_ESC,0,0);fText("タイトルに戻る",105,14,16,colorRGB(64,255,64));drawImg(Graphs.KEY_I,20+400,380);drawImg(Graphs.KEY_K,20+400,410);fText("メニュー選択",140+400,400,16,colorRGB(64,255,64));drawImg(Graphs.KEY_SPACE,20+400,440);fText("決定",140+400,450,16,colorRGB(64,255,64))} let selectEnemyY=0;function selectEnemy(){selectEnemyY=selectMenuY(selectEnemyY,20);drawImgS(Graphs.BG_MENU,0,0,DISPLAY_SIZE_X,DISPLAY_SIZE_Y);setAlp(50);drawImgS(Graphs.W_BG,0,0,DISPLAY_SIZE_X,DISPLAY_SIZE_Y);setAlp(100);drawImg(Graphs.KEY_ESC,0,0);fText("タイトルに戻る",105,14,16,colorRGB(64,255,64));drawImg(Graphs.KEY_I,20+400,380);drawImg(Graphs.KEY_K,20+400,410);fText("敵選択",140+400,400,16,colorRGB(64,255,64));drawImg(Graphs.KEY_SPACE,20+400,440);fText("決定",140+400,449,16,colorRGB(64,255,64));drawImg(Graphs.KEY_F,250,400);fText("戻る",250+50,400+10,16,colorRGB(64,255,64));for(let num=0;num<enemys.length;num++){if(num===selectEnemyY){color=colorRGB(255,64,64)}else{color=colorRGB(255,255,255)} fText(enemys[num].name,145,45+num*20,16,color)} if(key[32]===1||key[13]===1){recalcCharaNumMaxFromPositions();key[32]=2;key[13]=2;gameScene=SCENE_ENCOUNT;initEnemy(selectEnemyY);totalTime=0;enemy_timer=0;skill_num=0;enemy_turn_flag=0;attack_num=0;end_timer=0;bgmSwitch=BGM_OFF;stopBgm();for(let num=0;num<CHARA_NUM_MAX;num++){{charaHp[num]=charaMaxHp[num];charaState[num]=P_STATE_NOMAL}}} if(key[70]===1){key[70]=2;gameScene=SCENE_FREE_BATTLE;playSE(Sounds.SE_ESC)} if(key[27]===1){key[27]=2;playSE(Sounds.SE_ESC);stopBgm();bgmSwitch=BGM_OFF;gameScene=SCENE_TITLE;backScene=BS_TITLE}}