const Sounds={BGM_TITLE:0,BGM_TOWN:1,BGM_AREA1:2,BGM_AREA2:3,BGM_AREA3:4,BGM_AREA4:5,BGM_BATTLE:6,BGM_BOSS_BATTLE:7,BGM_LAST_BATTLE:8,BGM_ENDING:9,BGM_ENDING2:10,SE_SELECT:11,SE_ESC:12,SE_SPACE:13,SE_LOAD:14,SE_SAVE:15,SE_MY_TURN:16,SE_M_SHOT:17,SE_FIRE:18,SE_ICE:19,SE_THUNDER:20,SE_EXPLOSION:21,SE_STRIKE:22,SE_STRIKE_C:23,SE_SLASH:24,SE_GARD:25,SE_HOIHOI:26,SE_INPUT:27,SE_SHOP:28,SE_WARP:29,SE_STEP:30,SE_DEL0:31,SE_DOWN:32,SE_STRIKE_:33,SE_STRIKE_C_:34,SE_SLASH_:35};const soundFileNames=new Array("bgm/Shade/1_MapBGM.mp3","bgm/Shade/8_MapBGM2.mp3","bgm/Shade/BGM3_01.mp3","bgm/Shade/BGM3_02.mp3","bgm/Shade/BGM3_06_VAR1.mp3","bgm/Shade/BGM3_11.mp3","bgm/Shade/2_Battle_variation2.mp3","bgm/Shade/2_Battle_variation1.mp3","bgm/Shade/2_Battle.mp3","bgm/Shade/BGM3_07_VAR1.mp3","bgm/Shade/BGM3_07_VAR2.mp3","se/Shade/Cursor2.mp3","se/Shade/Cancel2.mp3","se/Shade/Decision1.mp3","se/Shade/Load.mp3","se/Shade/Save.mp3","se/pig/my_turn.mp3","se/m2/tm2_bom005.mp3","se/m2/tm2_bom003.mp3","se/m2/tm2_metalhit001.mp3","se/m2/tm2_lightning000.mp3","se/pig/explosion.mp3","se/m2/tm2_hit004.mp3","se/m2/hit_p08_c.mp3","se/m2/tm2_slash003.mp3","se/m2/tm2_metalhit001.mp3","se/m2/tm2_mind000.mp3","se/m2/tm2_swing005.mp3","se/m2/coin05.mp3","se/m2/tm2_laser002.mp3","se/m2/tm2_footstep000.mp3","se/m2/tm2_pon000.mp3","se/m2/tm2_bush001.mp3","se/m2/tm2_hit004_.mp3","se/m2/hit_p08_c_.mp3","se/m2/tm2_slash003_.mp3");function preloadAudio(url){return new Promise(function(ok,ng){const a=new Audio();let done=!1;function resolveOnce(){if(!done){done=!0;ok()}} function rejectOnce(e){if(!done){done=!0;ng(e)}} a.addEventListener("canplaythrough",resolveOnce,{once:!0});a.addEventListener("loadeddata",resolveOnce,{once:!0});a.addEventListener("error",rejectOnce,{once:!0});a.preload="auto";a.src=url;a.load()})} let soundNum=0;async function loadSounds(){const base="./material/";const jobs=new Array(soundFileNames.length);for(let i=0;i<soundFileNames.length;i++){jobs[i]=preloadAudio(base+soundFileNames[i])} await Promise.all(jobs);for(let i=0;i<soundFileNames.length;i++,soundNum++){loadSound(soundNum,base+soundFileNames[i])}}