const VERY_HARD2=0;const VERY_HARD=1;const HARD2=2;const HARD=3;const NOMAL=4;const EASY=5;const EASY2=6;let difficulty=NOMAL;let difficultyY=4;const hpPp=[2.0,1.75,1.5,1.25,1.0,0.75,0.5];const expPp=[1.0/2.0,1.0/1.75,1.0/1.5,1.0/1.25,1.0,1.0/0.75,1.0/0.5];const speedPp=[1.0/2.0,1.0/1.75,1.0/1.5,1.0/1.25,1.0,1.0/0.75,1.0/0.5];function selectDifficulty(){if(backScene===BS_TITLE||backScene===BS_DUNGEON||backScene===BS_FREE){if(bgmSwitch===BGM_OFF){bgmSwitch=BGM_ON;playBgm(Sounds.BGM_TITLE)} 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)}else if(backScene===BS_TOWN){if(bgmSwitch===BGM_OFF){bgmSwitch=BGM_ON;playBgm(Sounds.BGM_TOWN)} if(dungeon_count<DUNGEON_MAX){drawImg(Graphs.BG_TOWN,0,0)}else{drawImg(Graphs.BG_TOWN2,0,0)}} fText("【難易度選択】",500,45,25,colorRGB(255,255,255));let text=["VERY HARD2","VERY HARD","HARD2","HARD","NOMAL","EASY","EASY2"];difficultyY=selectMenuY(difficultyY,7);let color;for(let num=0;num<text.length;num++){if(num===difficultyY){color=colorRGB(255,64,64)}else{color=colorRGB(255,255,255)} fText(text[num],300,150+35*num,25,color)} let text2=["タイピング上級者向け++（敵HP:200%）","タイピング上級者向け（敵HP:175%）","タイピングに少し自信のある方向け++（敵HP:150%）","タイピングに少し自信のある方向け（敵HP:125%）","並みのタイピング力の方向け","タイピング全くの初心者向け（敵HP:75%）","タイピング全くの初心者向け--（敵HP:50%）"];fText(text2[difficultyY],320,425,20,colorRGB(255,255,255));if(key[32]===1||key[13]===1){key[32]=2;key[13]=2;switch(difficultyY){case 0:difficulty=VERY_HARD2;break;case 1:difficulty=VERY_HARD;break;case 2:difficulty=HARD2;break;case 3:difficulty=HARD;break;case 4:difficulty=NOMAL;break;case 5:difficulty=EASY;break;case 6:difficulty=EASY2;break} let hpList=[346.639467,267.433553,252.629413,392.846634,750.0,1241.877687,1736.123907,1400.962217,1600.301961,2449.3024265,2500.882656,4166.450457,3717.470513,3579.174329,9395.332613625,8332.542713,8407.979584,9702.548888,8726.269758,20000.430129];for(let num=0;num<enemys.length;num++){enemys[num].max_hp=hpList[num]*hpPp[difficulty]} let expList=[1.0,1.0,1.0,1.0,3.375,3.375,3.375,3.375,3.375,11.390625,11.390625,11.390625,11.390625,11.390625,38.44335938,38.44335938,38.44335938,38.44335938,38.44335938,129.7463379];for(let num=0;num<enemys.length;num++){enemys[num].exp=expList[num]*expPp[difficulty]} for(let num=0;num<CHARA_NUM_MAX;num++){charaSpeed[num]=lv1States[0].speed*(lvUpPp.speed_pp**charaLv[num])*speedPp[difficulty]} playSE(Sounds.SE_SPACE);if(backScene===BS_TOWN){gameScene=SCENE_TOWN}else if(backScene===BS_DUNGEON){gameScene=SCENE_DUNGEON}else if(backScene===BS_FREE){gameScene=SCENE_FREE_BATTLE}} drawImg(Graphs.KEY_ESC,0,0);fText("タイトルに戻る",105,14,16,colorRGB(64,255,64));drawImg(Graphs.KEY_I,100+400,320);drawImg(Graphs.KEY_K,100+400,350);fText("↑↓",215+400,350,16,colorRGB(64,255,64));drawImg(Graphs.KEY_SPACE,100+400,390);fText("決定",215+400,400,16,colorRGB(64,255,64));if(key[27]===1){key[27]=2;playSE(Sounds.SE_ESC);stopBgm();bgmSwitch=BGM_OFF;gameScene=SCENE_TITLE;backScene=BS_TITLE}}