diff --git a/README.md b/README.md index b93ec51..1427a5d 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,8 @@ # DanceDanceRevolution -**Plugin Version:** fork-mdx-3.0.2 +**Plugin Version:** fork-mdx-3.0.3 -**Supported game versions:** WORLD (2024091000) - -**Unsupported game versions:** Everything below A20 is unsupported. A20 untested. A3 unsupported. +**Supported game versions:** WORLD (2024101500) **Required Asphyxia Core version** [1.50c](https://github.com/asphyxia-core/asphyxia-core.github.io/releases/tag/v1.50) @@ -28,6 +26,17 @@ musicdb.xml Usage Guide Changelog =========== +### fork-mdx-3.0.3 + +- Fixed WebUI flare skill calculation mistake. +- Added "unlock all songs" option. + - Still requires musicdb.xml to get the song ids. +- Added Triple Tribe 4 event data. + - Gold cab exclusive, otherwise the songs will not appear in the songs list. + - You can use patches to force the game to imitate gold cab. +- Added "Step This Way" Challenge difficulties + + ### fork-mdx-3.0.2 - WORLD LEAGUE @@ -71,14 +80,6 @@ Changelog - Music/score table -### fork-mdx-3.0.0b - -- Flare skill song unlock event.... on Doubles. - - Fixes crashes on Flare Skill rank up.... on Doubles (again, just tested until Mercury.) - - Event list updated -- ghostdata saving and loading (WIP, idk what ghost is) - - To do: =========== diff --git a/data/world.ts b/data/world.ts index 1c7dd6b..ce5806c 100644 --- a/data/world.ts +++ b/data/world.ts @@ -52,11 +52,18 @@ export const SONGS_WORLD = [ { mcode: 37222, limited_ary: [2, 2, 2, 2, -1, -1, 2, 2, 2, -1], diffLv: [2, 4, 10, 13, 0, 0, 4, 9, 13, 0] }, { mcode: 37604, limited_ary: [2, 2, 2, 2, 2, -1, 2, 2, 2, 2], diffLv: [2, 6, 9, 12, 14, 0, 5, 9, 12, 14] }, { mcode: 37234, limited_ary: [0, 0, 0, 0, -1, -1, 0, 0, 0, -1], diffLv: [1, 3, 7, 11, 0, 0, 3, 7, 11, 0] }, - { mcode: 37363, limited_ary: [2, 2, 2, 2, -1, -1, 2, 2, 2, -1], diffLv: [2, 5, 9, 13, 0, 0, 5, 9, 13, 0] } + { mcode: 37363, limited_ary: [2, 2, 2, 2, -1, -1, 2, 2, 2, -1], diffLv: [2, 5, 9, 13, 0, 0, 5, 9, 13, 0] }, + + { mcode: 38756, limited_ary: [2, 2, 2, 2, -1, -1, 2, 2, 2, -1], diffLv: [3, 8, 15, 18, 0, 0, 8, 14, 18, 0] }, + { mcode: 38758, limited_ary: [2, 2, 2, 2, -1, -1, 2, 2, 2, -1], diffLv: [5, 10, 13, 17, 0, 0, 10, 13, 17, 0] }, + { mcode: 38759, limited_ary: [2, 2, 2, 2, -1, -1, 2, 2, 2, -1], diffLv: [3, 6, 13, 15, 0, 0, 7, 13, 15, 0] }, // songs that have yet to release. unknown difficulty lvls. - // { mcode: 38622, limited_ary: [], diffLv: [] } - + // { mcode: 38622, limited_ary: [], diffLv: [] }, + // { mcode: 38629, limited_ary: [], diffLv: [] }, + // { mcode: 38757, limited_ary: [], diffLv: [] }, + // { mcode: 38760, limited_ary: [], diffLv: [] }, + // { mcode: 38761, limited_ary: [], diffLv: [] } ] export const SONGS_OVERRIDE_WORLD = [ @@ -216,7 +223,12 @@ export const SONGS_OVERRIDE_WORLD = [ { mcode: 38420, limited_ary: [0, 0, 0, 0, 2, -1, 0, 0, 0, 2], diffLv: [4, 8, 12, 15, 17, 0, 8, 12, 15, 17] }, { mcode: 38405, limited_ary: [0, 0, 0, 0, 2, -1, 0, 0, 0, 2], diffLv: [3, 6, 9, 13, 17, 0, 5, 9, 14, 17] }, { mcode: 38442, limited_ary: [0, 0, 0, 0, 2, -1, 0, 0, 0, 2], diffLv: [3, 8, 13, 16, 18, 0, 8, 13, 16, 18] }, - { mcode: 38436, limited_ary: [0, 0, 0, 0, 2, -1, 0, 0, 0, 2], diffLv: [4, 7, 11, 14, 17, 0, 7, 11, 14, 17] } + { mcode: 38436, limited_ary: [0, 0, 0, 0, 2, -1, 0, 0, 0, 2], diffLv: [4, 7, 11, 14, 17, 0, 7, 11, 14, 17] }, + { mcode: 38407, limited_ary: [0, 0, 0, 0, 0, -1, 0, 0, 0, 0], diffLv: [4, 9, 12, 16, 17, 0, 9, 12, 16, 17] }, + + // { mcode: 38339, limited_ary: [0, 0, 0, 0, 0, -1, 0, 0, 0, 0], diffLv: [3, 7, 11, 14, ?, 0, 7, 11, 14, ?] }, + // { mcode: 38424, limited_ary: [0, 0, 0, 0, 0, -1, 0, 0, 0, 0], diffLv: [4, 8, 11, 14, ?, 0, 8, 11, 14, ?] }, + // { mcode: 38428, limited_ary: [0, 0, 0, 0, 0, -1, 0, 0, 0, 0], diffLv: [4, 8, 12, 16, ?, 0, 8, 12, 16, ?] }, ] export const EVENTS_WORLD = [ @@ -271,7 +283,12 @@ export const EVENTS_WORLD = [ { id: 105, no: 0, cond: 1, rwrd: 37604, type: 52 }, { id: 106, no: 0, cond: 1, rwrd: 37234, type: 50 }, { id: 107, no: 0, cond: 1, rwrd: 37363, type: 50 }, - { id: 108, no: 0, cond: 1, rwrd: 38436, type: 52 } + { id: 108, no: 0, cond: 1, rwrd: 38436, type: 52 }, + // Triple tribe 4. Song does not appear if non-Gold. + { id: 109, no: 0, cond: 1, rwrd: 1197, type: 201, save: 1 }, + { id: 110, no: 0, cond: 1, rwrd: 38759, type: 43, comp: 0, save: 1 }, + { id: 111, no: 0, cond: 1, rwrd: 38758, type: 43, comp: 0, save: 1 }, + { id: 112, no: 0, cond: 1, rwrd: 38756, type: 43, comp: 0, save: 1 } ] export const LEAGUE_WORLD = [ diff --git a/handlers/ddrworld.ts b/handlers/ddrworld.ts index 968cddf..337872f 100644 --- a/handlers/ddrworld.ts +++ b/handlers/ddrworld.ts @@ -27,7 +27,6 @@ async function saveScores(refid: string, hiScoreInfo: any, songId: number, style let stepGhost = await DB.FindOne(null, {collection: "ghost3", ghostId: ghostId }) if(stepGhost) { - if(score >= stepScore.score) console.log("overwriting ghostdata") ghostSize = (score >= stepScore.score) ? ghostSize : stepGhost.ghostSize ghost = (score >= stepScore.score) ? ghost : stepGhost.ghost } @@ -58,7 +57,6 @@ async function saveScores(refid: string, hiScoreInfo: any, songId: number, style } }); - console.log("saving ghostid: " + ghostId) await DB.Upsert(refid, { collection: "ghost3", ghostId, @@ -84,7 +82,6 @@ async function saveScores(refid: string, hiScoreInfo: any, songId: number, style // Hiscore stuff let hiScoreWorld1 = await DB.FindOne(null, {collection: 'hiscore3', slot: 1, songId: songId, style: style, difficulty: difficulty}) - console.log('--------------------------------------------------------------') ghostData = await DB.Find(null, {collection: "ghost3"}) lastGhostId = getLastGhostId(ghostData) ghostId = 0 @@ -92,27 +89,21 @@ async function saveScores(refid: string, hiScoreInfo: any, songId: number, style else ghostId = lastGhostId += 1 if(hiScoreWorld1) { - console.log('[world1] ' + hiScoreCheck + ' >= ' + hiScoreWorld1.score) if(hiScoreCheck >= hiScoreWorld1.score) { - console.log('[world1] high score beat') worldBreak = true ghostId = (hiScoreWorld1.ghostId) ? hiScoreWorld1.ghostId : ghostId - console.log('[world1] ghostid exists, saving to id ' + ghostId) await DB.Upsert(refid, {collection: "ghost3", ghostId }, {$set: { ghostSize, ghost }}); } } else { worldBreak = true - console.log('[world1] entry does not exist. creating') await DB.Upsert(refid, {collection: "ghost3", ghostId }, {$set: { ghostSize, ghost }}); } slot = 1 if(worldBreak) { - console.log("[world1] saving hiscore - ghost id " + ghostId) await DB.Upsert(refid, {collection: "hiscore3", slot, songId, style, difficulty}, { $set: { country, region, customerCode, companyCode, locationId, pcbid, dancerName, score: hiScoreCheck, ghostId }}); } let hiScoreArea1 = await DB.FindOne(null, {collection: 'hiscore3', slot: 2, locationId: locationId, songId: songId, style: style, difficulty: difficulty}) - console.log('--------------------------------------------------------------') ghostData = await DB.Find(null, {collection: "ghost3"}) lastGhostId = getLastGhostId(ghostData) ghostId = 0 @@ -120,28 +111,22 @@ async function saveScores(refid: string, hiScoreInfo: any, songId: number, style else ghostId = lastGhostId += 1 if(hiScoreArea1) { - console.log('[area1] ' + hiScoreCheck + ' >= ' + hiScoreArea1.score) if(hiScoreCheck >= hiScoreArea1.score) { - console.log('[area1] high score beat') areaBreak = true ghostId = (hiScoreArea1.ghostId) ? hiScoreArea1.ghostId : ghostId - console.log('[area1] ghostid exists, saving to id ' + ghostId) await DB.Upsert(refid, {collection: "ghost3", ghostId }, {$set: { ghostSize, ghost }}); } } else { areaBreak = true - console.log('[area1] entry does not exist. creating') await DB.Upsert(refid, {collection: "ghost3", ghostId }, {$set: { ghostSize, ghost }}); } slot = 2 if(areaBreak) { - console.log("[area1] saving hiscore - ghost id " + ghostId) await DB.Upsert(refid, {collection: "hiscore3", slot, locationId, songId, style, difficulty}, { $set: { country, region, customerCode, companyCode, pcbid, dancerName, score: hiScoreCheck, ghostId }}); } let hiScoreMachine1 = await DB.FindOne(null, {collection: 'hiscore3', slot: 3, locationId: locationId, pcbid: pcbid, songId: songId, style: style, difficulty: difficulty}) - console.log('--------------------------------------------------------------') ghostData = await DB.Find(null, {collection: "ghost3"}) lastGhostId = getLastGhostId(ghostData) ghostId = 0 @@ -149,22 +134,17 @@ async function saveScores(refid: string, hiScoreInfo: any, songId: number, style else ghostId = lastGhostId += 1 if(hiScoreMachine1) { - console.log('[machine1] ' + hiScoreCheck + ' >= ' + hiScoreMachine1.score) if(hiScoreCheck >= hiScoreMachine1.score) { - console.log('[machine1] high score beat') machineBreak = true ghostId = (hiScoreMachine1.ghostId) ? hiScoreMachine1.ghostId : ghostId - console.log('[machine1] ghostid exists, saving to id ' + ghostId) await DB.Upsert(refid, {collection: "ghost3", ghostId }, {$set: { ghostSize, ghost }}); } } else { machineBreak = true - console.log('[machine1] entry does not exist. creating') await DB.Upsert(refid, {collection: "ghost3", ghostId }, {$set: { ghostSize, ghost }}); } slot = 3 if(machineBreak) { - console.log("[machine1] saving hiscore - ghost id " + ghostId) await DB.Upsert(refid, {collection: "hiscore3", slot, locationId, pcbid, songId, style, difficulty}, { $set: { country, region, customerCode, companyCode, dancerName, score: hiScoreCheck, ghostId }}); } } @@ -541,6 +521,7 @@ export const playerdataload: EPR = async (info, data, send) => { for(const event of EVENTS_WORLD) { let eData = eventData.find(e => e.eventId === event.id) let condmet = true + let compTime = 0 if(event.dep) { event.dep.forEach(dep => { let eData = eventData.find(e => e.eventId === dep) @@ -550,12 +531,12 @@ export const playerdataload: EPR = async (info, data, send) => { } // id,type,no,condition,reward,comptime,savedata if(condmet) { - if(event.type === 17) { + if([17, 43].includes(event.type)) { if (eData) eData.compTime = eData.compTime ? 0 : 1 - event.comp = event.comp ? 0 : 1 + compTime = event.comp ? 0 : 1 } eventFin.push({ - event_str: K.ITEM('str', event.id + ',' + event.type + ',' + event.no + ',' + event.cond + ',' + event.rwrd + ',' + (eData ? BigInt(eData.compTime) : (event.comp !== undefined ? event.comp : '0')) + ',' + ((eData) ? eData.saveData : ((event.save !== undefined) ? event.save : '0'))) + event_str: K.ITEM('str', event.id + ',' + event.type + ',' + event.no + ',' + event.cond + ',' + event.rwrd + ',' + (eData ? BigInt(eData.compTime) : compTime) + ',' + ((eData) ? eData.saveData : ((event.save !== undefined) ? event.save : '0'))) }) } } @@ -809,7 +790,7 @@ export const musicdataload: EPR = async (info, data, send) => { } musicList.push({ - music_str: K.ITEM('str', $(music).number('mcode') + ',' + ((index > 4) ? '1,' : '0,') + (index % 5) + ',' + limited + ',' + diff) + music_str: K.ITEM('str', $(music).number('mcode') + ',' + ((index > 4) ? '1,' : '0,') + (index % 5) + ',' + (U.GetConfig('song_unlock') && limited != -1 ? '0' : limited) + ',' + diff) }) } } @@ -820,7 +801,7 @@ export const musicdataload: EPR = async (info, data, send) => { for(const [index, diff] of music.diffLv.entries()) { if(music.limited_ary[index] != -1) { musicList.push({ - music_str: K.ITEM('str', music.mcode + ',' + ((index > 4) ? '1,' : '0,') + (index % 5) + ',' + music.limited_ary[index] + ',' + diff) + music_str: K.ITEM('str', music.mcode + ',' + ((index > 4) ? '1,' : '0,') + (index % 5) + ',' + (U.GetConfig('song_unlock') && music.limited_ary[index] != -1 ? '0' : music.limited_ary[index]) + ',' + diff) }) } } @@ -884,7 +865,6 @@ export const rivaldataload: EPR = async (info, data, send) => { export const ghostdataload: EPR = async (info, data, send) => { const refid = $(data).str("data.refid"); const ghostId = $(data).number("data.ghostid"); - console.log("loading ghostid: " + ghostId) let ghostData = await DB.FindOne(null, {collection: 'ghost3', ghostId: ghostId}) if(ghostData) { return send.object({ diff --git a/index.ts b/index.ts index c0d5205..09626a4 100644 --- a/index.ts +++ b/index.ts @@ -18,6 +18,12 @@ export function register() { default: true, type: "boolean" }); + R.Config("song_unlock", { + name: "Unlock all songs", + desc: "Still requires musicdb.xml to get the song ids.", + default: true, + type: "boolean" + }); R.Config("mdb_limited", { name: "musicdb.xml for musicdata_load", desc: "musicdb.xml file to use for importing limited and diffLv info. Put this xml file in the 'data' directory of the plugin.", diff --git a/webui/js/common.js b/webui/js/common.js index ec60cde..cefbdc3 100644 --- a/webui/js/common.js +++ b/webui/js/common.js @@ -92,30 +92,30 @@ async function getFlareInfo(scores) { }) flareData.classicSgTop30 = flareTopScores.sg.filter(ft => ft.series <= 13).sort((a, b) => b.flare - a.flare) - if(flareData.classicSgTop30.length > 30) flareData.classicSgTop30.slice(0, 30) + if(flareData.classicSgTop30.length > 30) flareData.classicSgTop30 = flareData.classicSgTop30.slice(0, 30) flareData.classicSgFlare = flareData.classicSgTop30.reduce((n, {flare}) => n + flare, 0) flareData.whiteSgTop30 = flareTopScores.sg.filter(ft => ft.series >= 14 && ft.series <= 17).sort((a, b) => b.flare - a.flare) - if(flareData.whiteSgTop30.length > 30) flareData.whiteSgTop30.slice(0, 30) + if(flareData.whiteSgTop30.length > 30) flareData.whiteSgTop30 = flareData.whiteSgTop30.slice(0, 30) flareData.whiteSgFlare = flareData.whiteSgTop30.reduce((n, {flare}) => n + flare, 0) flareData.goldSgTop30 = flareTopScores.sg.filter(ft => ft.series >= 18).sort((a, b) => b.flare - a.flare) - if(flareData.goldSgTop30.length > 30) flareData.goldSgTop30.slice(0, 30) + if(flareData.goldSgTop30.length > 30) flareData.goldSgTop30 = flareData.goldSgTop30.slice(0, 30) flareData.goldSgFlare = flareData.goldSgTop30.reduce((n, {flare}) => n + flare, 0) flareData.totalSgFlare = flareData.classicSgTop30.concat(flareData.whiteSgTop30, flareData.goldSgTop30).reduce((n, {flare}) => n + flare, 0) flareData.classicDbTop30 = flareTopScores.db.filter(ft => ft.series <= 13).sort((a, b) => b.flare - a.flare) - if(flareData.classicDbTop30.length > 30) flareData.classicDbTop30.slice(0, 30) + if(flareData.classicDbTop30.length > 30) flareData.classicDbTop30 = flareData.classicDbTop30.slice(0, 30) flareData.classicDbFlare = flareData.classicDbTop30.reduce((n, {flare}) => n + flare, 0) flareData.whiteDbTop30 = flareTopScores.db.filter(ft => ft.series >= 14 && ft.series <= 17).sort((a, b) => b.flare - a.flare) - if(flareData.whiteDbTop30.length > 30) flareData.whiteDbTop30.slice(0, 30) + if(flareData.whiteDbTop30.length > 30) flareData.whiteDbTop30 = flareData.whiteDbTop30.slice(0, 30) flareData.whiteDbFlare = flareData.whiteDbTop30.reduce((n, {flare}) => n + flare, 0) flareData.goldDbTop30 = flareTopScores.db.filter(ft => ft.series >= 18).sort((a, b) => b.flare - a.flare) - if(flareData.goldDbTop30.length > 30) flareData.goldDbTop30.slice(0, 30) + if(flareData.goldDbTop30.length > 30) flareData.goldDbTop30 = flareData.goldDbTop30.slice(0, 30) flareData.goldDbFlare = flareData.goldDbTop30.reduce((n, {flare}) => n + flare, 0) flareData.totalDbFlare = flareData.classicDbTop30.concat(flareData.whiteDbTop30, flareData.goldDbTop30).reduce((n, {flare}) => n + flare, 0)