diff --git a/sdvx@asphyxia/README.md b/sdvx@asphyxia/README.md index 2e91bdb..d71ad3e 100644 --- a/sdvx@asphyxia/README.md +++ b/sdvx@asphyxia/README.md @@ -1,8 +1,8 @@ # SOUND VOLTEX -**Plugin Version:** fork-6.0.3.0 +**Plugin Version:** fork-6.0.3.1 -**Supported game versions:** EXCEED GEAR (2024031801) +**Supported game versions:** EXCEED GEAR (2024040200) **Unsupported game versions:** Every other game, as they're untested. @@ -16,6 +16,24 @@ Changelog =========== +## fork-6.0.3.1 + +### New: + +1. Main: + - 2024040200 support + - Added BPL Season 3 Complete Stamp Event - collect stamps by clearing the BPL S3 songs to unlock NEMSYS ARENA World Hexathlon and 2 new songs. + - Check "Unlocking Events -> Stamp Events -> BPL S3 Complete Stamp Event" to toggle the stamp event. + - Added Mini Grace gift. + - Check "Unlocking Events -> Gift Events -> Mini Grace NEMSYS Crew Gift" to toggle the gift. +2. Misc: + - Added option to apply frames on the appeal card. Check out "Appeal Card Frame" in the customization page for the list of frames. + - Rival implementation. Check "Rivals" page under your profile. + - Originally this plugin will send all profiles as rivals. Users can now make their own list of rivals. + - Added simple score comparison table with your rival/s. + - Cleaned up stamp event code & data. + + ## fork-6.0.3.0 ### New: @@ -27,8 +45,8 @@ Changelog - Fixed ARENA Season 12 rule from 1 (point system) to 2 (voting system) - Added ARENA-related startup flags to exg.ts (arena room id input, online/local match rule voting system, etc.) - Updated system backgrounds list in customize\_data\_ext.json (forgot to update it as it's manual, sorry...) - - Added new APRIL\_RAINBOW\_LINE\_ACTIVE to startup flags toggle list. Don't know what it does currently. - - Edit: Enables April Fools 2024 Effect: Rainbow lasers. Type V-RAN on search bar to enable. + - Added new APRIL\_RAINBOW\_LINE\_ACTIVE to startup flags toggle list. + - Enables April Fools 2024 Effect. Toggle this flag on and type V-RAN on the song search bar to activate it. - Added lounge code (checks for active matches to toggle 'matching' indicator in lounge) - Fixes to profile customization WebUI js where 1: subbg selection doesn't match the one previewed, and 2: it provides the incorrect subbg file format. - Some online matchmaking experimentations (still can't make it work though) @@ -47,15 +65,8 @@ Changelog - Tweaked Premium Generator odds (1% chance for a crew is a bit unfair lol, changed to 5%) -## fork-6.0.2.8d - -### New: - -1. Main: - - Updated events.json to add startup flags for Valentines Day 2024 and White Day 2024. - - ### Todo: 1. Figure out how to use image (png) files to appear in information/news popup. 2. More work on online matchmaking (idk if this is possible) +3. Implement pro_team_id setting. diff --git a/sdvx@asphyxia/data/exg.ts b/sdvx@asphyxia/data/exg.ts index 5eb9c16..07730cf 100644 --- a/sdvx@asphyxia/data/exg.ts +++ b/sdvx@asphyxia/data/exg.ts @@ -95,62 +95,42 @@ export const STAMP_EVENTS6 = { 'stmpHd': '[sz:22][c:DAC491]SPECIAL STAMP BONUS', 'stmpFt': '[sz:22]YOU CAN GET A STAMP AND BONUS! :)[br:5]TERM: 1/18~3/21', 'stmpBg': 'bg_stamp_anniversary_10th', + 'sheet': '1#sheet_track_1#e#1838,2#sheet_track_2#e#1839,3#sheet_track_3#e#1840,4#sheet_track_4#e#1841,5#sheet_track_5#e#1842,6#sheet_track_6#e#1843,7#sheet_track_7#e#1844', 'data': [ { 'stmpid': 1, - 'bnr': 'sheet_track_1', 'stps': 5, - 'stprwrd': [ - ['5', 'track', '1838', '23'] - ] + 'stprwrd': '5:e:183823' }, { 'stmpid': 2, - 'bnr': 'sheet_track_2', 'stps': 5, - 'stprwrd': [ - ['5', 'track', '1839', '23'] - ] + 'stprwrd': '5:e:183923' }, { 'stmpid': 3, - 'bnr': 'sheet_track_3', 'stps': 5, - 'stprwrd': [ - ['5', 'track', '1840', '23'] - ] + 'stprwrd': '5:e:184023' }, { 'stmpid': 4, - 'bnr': 'sheet_track_4', 'stps': 5, - 'stprwrd': [ - ['5', 'track', '1841', '23'] - ] + 'stprwrd': '5:e:184123' }, { 'stmpid': 5, - 'bnr': 'sheet_track_5', 'stps': 5, - 'stprwrd': [ - ['5', 'track', '1842', '23'] - ] + 'stprwrd': '5:e:184223' }, { 'stmpid': 6, - 'bnr': 'sheet_track_6', 'stps': 5, - 'stprwrd': [ - ['5', 'track', '1843', '23'] - ] + 'stprwrd': '5:e:184323' }, { 'stmpid': 7, - 'bnr': 'sheet_track_7', 'stps': 5, - 'stprwrd': [ - ['5', 'track', '1844', '23'] - ] + 'stprwrd': '5:e:184423' } ] } @@ -159,23 +139,13 @@ export const STAMP_EVENTS6 = { 'type': 'main', 'info': { 'id': 0, - 'stmpSlHd': '', - 'stmpSlFt': '', 'stmpHd': '[sz:22][c:DAC491]SPECIAL STAMP BONUS', 'stmpFt': '[sz:22]YOU CAN GET A STAMP AND BONUS! :)[br:5]TERM: 3/30~5/8', - 'stmpBg': '', 'data': [ { 'stmpid': 8, - 'bnr': '', 'stps': 15, - 'stprwrd': [ - ['1', 'track', '1853', '23'], - ['3', 'track', '1851', '23'], - ['6', 'track', '1852', '23'], - ['10', 'track', '1850', '23'], - ['15', 'track', '1854', '23'], - ] + 'stprwrd': '1:e:185323 3:e:185123 6:e:185223 10:e:185023 15:e:185423' } ] } @@ -184,23 +154,13 @@ export const STAMP_EVENTS6 = { 'type': 'main', 'info': { 'id': 0, - 'stmpSlHd': '', - 'stmpSlFt': '', 'stmpHd': '[sz:22][c:DAC491]SPECIAL STAMP BONUS', 'stmpFt': '[sz:22]YOU CAN GET A STAMP AND BONUS! :)[br:5]TERM: 12/8~1/15', - 'stmpBg': '', 'data': [ { 'stmpid': 9, - 'bnr': '', 'stps': 5, - 'stprwrd': [ - ['1', 'pcb', '500', ''], - ['2', 'pcb', '500', ''], - ['3', 'pcb', '1000', ''], - ['4', 'pcb', '1000', ''], - ['5', 'pcb', '2000', ''], - ] + 'stprwrd': '1:b:500 2:b:500 3:b:1000 4:b:1000 5:b:2000' } ] } @@ -209,19 +169,13 @@ export const STAMP_EVENTS6 = { 'type': 'main', 'info': { 'id': 0, - 'stmpSlHd': '', - 'stmpSlFt': '', 'stmpHd': '[sz:22]SPECIAL STAMP BONUS', 'stmpFt': '[sz:22]YOU CAN GET A STAMP AND BONUS! :)[br:5]TERM: 1/1~1/9', - 'stmpBg': '', 'data': [ { 'stmpid': 10, - 'bnr': '', 'stps': 1, - 'stprwrd': [ - ['1', 'appeal', '5522', ''] - ] + 'stprwrd': '1:a:5522' } ] } @@ -235,50 +189,17 @@ export const STAMP_EVENTS6 = { 'stmpHd': '[sz:22][c:DAC491]SPECIAL STAMP BONUS', 'stmpFt': '[sz:22]YOU CAN GET A STAMP AND BONUS! :)[br:5]TERM: 4/7~5/8', 'stmpBg': 'bg_stamp_himehina', + 'sheet': '11#sheet_crew_1#c#ネメシスクルー田中ヒメ,12#sheet_crew_2#c#ネメシスクルー鈴木ヒナ', 'data': [ { 'stmpid': 11, - 'bnr': 'sheet_crew_1', 'stps': 15, - 'stprwrd': [ - ['1', 'pcb', '100', ''], - ['2', 'pcb', '100', ''], - ['3', 'pcb', '100', ''], - ['4', 'pcb', '100', ''], - ['5', 'pcb', '1000', ''], - ['6', 'pcb', '200', ''], - ['7', 'pcb', '200', ''], - ['8', 'pcb', '200', ''], - ['9', 'pcb', '200', ''], - ['10', 'pcb', '2000', ''], - ['11', 'pcb', '500', ''], - ['12', 'pcb', '500', ''], - ['13', 'pcb', '500', ''], - ['14', 'pcb', '500', ''], - ['15', 'crew', '122', 'ネメシスクルー田中ヒメ'] - ] + 'stprwrd': '1:b:100 2:b:100 3:b:100 4:b:100 5:b:1000 6:b:200 7:b:200 8:b:200 9:b:200 10:b:2000 11:b:500 12:b:500 13:b:500 14:b:500 15:c:122', }, { 'stmpid': 12, - 'bnr': 'sheet_crew_2', 'stps': 15, - 'stprwrd': [ - ['1', 'pcb', '100', ''], - ['2', 'pcb', '100', ''], - ['3', 'pcb', '100', ''], - ['4', 'pcb', '100', ''], - ['5', 'pcb', '1000', ''], - ['6', 'pcb', '200', ''], - ['7', 'pcb', '200', ''], - ['8', 'pcb', '200', ''], - ['9', 'pcb', '200', ''], - ['10', 'pcb', '2000', ''], - ['11', 'pcb', '500', ''], - ['12', 'pcb', '500', ''], - ['13', 'pcb', '500', ''], - ['14', 'pcb', '500', ''], - ['15', 'crew', '123', 'ネメシスクルー鈴木ヒナ'] - ] + 'stprwrd': '1:b:100 2:b:100 3:b:100 4:b:100 5:b:1000 6:b:200 7:b:200 8:b:200 9:b:200 10:b:2000 11:b:500 12:b:500 13:b:500 14:b:500 15:c:123', } ] } @@ -287,19 +208,13 @@ export const STAMP_EVENTS6 = { 'type': 'main', 'info': { 'id': 0, - 'stmpSlHd': '', - 'stmpSlFt': '', 'stmpHd': '[sz:22]SPECIAL STAMP BONUS', 'stmpFt': '[sz:22]YOU CAN GET A STAMP AND BONUS! :)[br:5]TERM: 1/1~1/9', - 'stmpBg': '', 'data': [ { 'stmpid': 13, - 'bnr': '', 'stps': 1, - 'stprwrd': [ - ['1', 'appeal', '5523', ''] - ] + 'stprwrd': '1:a:5523' } ] } @@ -314,86 +229,52 @@ export const STAMP_EVENTS6 = { 'stmpHd': '[sz:22][c:DAC491]BEMANI PRO LEAGUE -SEASON 2- SPECIAL STAMP', 'stmpFt': '[sz:22]YOU CAN GET STAMPS BY PLAYING SDVX!', 'stmpBg': 'bg_stamp_bpl', + 'sheet': '14#sheet_track_1919#e#1919,15#sheet_track_1920#e#1920,16#sheet_track_1921#e#1921,17#sheet_track_1922#e#1922,18#sheet_track_1923#e#1923,19#sheet_track_1924#e#1924,20#sheet_track_1925#e#1925,21#sheet_track_1926#e#1926,22#sheet_track_1938#e#1938', 'data': [ { 'stmpid': 14, - 'bnr': 'sheet_track_1919', 'stps': 15, - 'stprwrd': [ - ['15', 'track', '1919', '23'] - ] + 'stprwrd': '15:e:191923' }, { 'stmpid': 15, - 'bnr': 'sheet_track_1920', 'stps': 15, - 'stprwrd': [ - ['15', 'track', '1920', '23'] - ] + 'stprwrd': '15:e:192023' }, { 'stmpid': 16, - 'bnr': 'sheet_track_1921', 'stps': 15, - 'stprwrd': [ - ['15', 'track', '1921', '23'] - ] + 'stprwrd': '15:e:192123' }, { 'stmpid': 17, - 'bnr': 'sheet_track_1922', 'stps': 15, - 'stprwrd': [ - ['15', 'track', '1922', '23'] - ] + 'stprwrd': '15:e:192223' }, { 'stmpid': 18, - 'bnr': 'sheet_track_1923', 'stps': 15, - 'stprwrd': [ - ['15', 'track', '1923', '23'] - ] + 'stprwrd': '15:e:192323' }, { 'stmpid': 19, - 'bnr': 'sheet_track_1924', 'stps': 15, - 'stprwrd': [ - ['15', 'track', '1924', '23'] - ] + 'stprwrd': '15:e:192423' }, { 'stmpid': 20, - 'bnr': 'sheet_track_1925', 'stps': 15, - 'stprwrd': [ - ['15', 'track', '1925', '23'] - ] + 'stprwrd': '15:e:192523' }, { 'stmpid': 21, - 'bnr': 'sheet_track_1926', 'stps': 15, - 'stprwrd': [ - ['15', 'track', '1926', '23'] - ] + 'stprwrd': '15:e:192623' }, { 'stmpid': 22, - 'bnr': 'sheet_track_1938', 'stps': 30, - 'stprwrd': [ - ['0', 'prereq', 'x', '14'], - ['0', 'prereq', 'x', '15'], - ['0', 'prereq', 'x', '16'], - ['0', 'prereq', 'x', '17'], - ['0', 'prereq', 'x', '18'], - ['0', 'prereq', 'x', '19'], - ['0', 'prereq', 'x', '20'], - ['0', 'prereq', 'x', '21'], - ['30', 'track', '1938', '23'] - ] + 'stprwrd': '0:r:x14 0:r:x15 0:r:x16 0:r:x17 0:r:x18 0:r:x19 0:r:x20 0:r:x21 30:e:193823' } ] } @@ -402,19 +283,13 @@ export const STAMP_EVENTS6 = { 'type': 'main', 'info': { 'id': 0, - 'stmpSlHd': '', - 'stmpSlFt': '', 'stmpHd': '[sz:22][c:DAC491]SPECIAL STAMP BONUS', 'stmpFt': '[sz:22]YOU CAN GET A STAMP AND BONUS! :)[br:5]TERM: 8/9~9/11', - 'stmpBg': '', 'data': [ { 'stmpid': 23, - 'bnr': '', 'stps': 10, - 'stprwrd': [ - ['10', 'track', '2060', '23'], - ] + 'stprwrd': '10:e:206023' } ] } @@ -428,22 +303,17 @@ export const STAMP_EVENTS6 = { 'stmpHd': '[sz:22][c:DAC491]SPECIAL STAMP BONUS', 'stmpFt': '[sz:22]YOU CAN GET A STAMP AND BONUS! :)[br:5]TERM: 9/20~10/23', 'stmpBg': 'bg_stamp_kac_11th', + 'sheet': '24#sheet_track_2061#e#2061,25#sheet_track_2062#e#2062', 'data': [ { 'stmpid': 24, - 'bnr': 'sheet_track_2061', 'stps': 10, - 'stprwrd': [ - ['10', 'track', '2061', '23'] - ] + 'stprwrd': '10:e:206123' }, { 'stmpid': 25, - 'bnr': 'sheet_track_2062', 'stps': 10, - 'stprwrd': [ - ['10', 'track', '2062', '23'] - ] + 'stprwrd': '10:e:206223' } ] } @@ -452,28 +322,13 @@ export const STAMP_EVENTS6 = { 'type': 'main', 'info': { 'id': 0, - 'stmpSlHd': '', - 'stmpSlFt': '', 'stmpHd': '[sz:22][c:DAC491]SPECIAL STAMP BONUS', 'stmpFt': '[sz:22]YOU CAN GET A STAMP AND BONUS! :)[br:5]TERM: 1/1~1/8', - 'stmpBg': '', 'data': [ { 'stmpid': 26, - 'bnr': '', 'stps': 10, - 'stprwrd': [ - ['1', 'appeal', '5526', ''], - ['2', 'pcb', '2024', ''], - ['3', 'pcb', '2024', ''], - ['4', 'pcb', '2024', ''], - ['5', 'pcb', '2024', ''], - ['6', 'pcb', '2024', ''], - ['7', 'pcb', '2024', ''], - ['8', 'pcb', '2024', ''], - ['9', 'pcb', '2024', ''], - ['10', 'pcb', '4649', ''] - ] + 'stprwrd': '1:a:5526 2:b:2024 3:b:2024 4:b:2024 5:b:2024 6:b:2024 7:b:2024 8:b:2024 9:b:2024 10:b:4649' } ] } @@ -482,19 +337,13 @@ export const STAMP_EVENTS6 = { 'type': 'main', 'info': { 'id': 0, - 'stmpSlHd': '', - 'stmpSlFt': '', 'stmpHd': '[sz:22][c:DAC491]SPECIAL STAMP BONUS', 'stmpFt': '[sz:22]YOU CAN GET A STAMP AND BONUS! :)[br:5]TERM: 1/18~2/4', - 'stmpBg': '', 'data': [ { 'stmpid': 27, - 'bnr': '', 'stps': 1, - 'stprwrd': [ - ['1', 'appeal', '5527', ''] - ] + 'stprwrd': '1:a:5527' } ] } @@ -503,36 +352,45 @@ export const STAMP_EVENTS6 = { 'type': 'main', 'info': { 'id': 0, - 'stmpSlHd': '', - 'stmpSlFt': '', 'stmpHd': '[sz:22][c:DAC491]SPECIAL STAMP BONUS', 'stmpFt': '[sz:22]YOU CAN GET A STAMP AND BONUS! :)[br:5]TERM: 1/1~1/8', - 'stmpBg': '', 'data': [ { 'stmpid': 28, - 'bnr': '', 'stps': 10, - 'stprwrd': [ - ['1', 'pcb', '329', ''], - ['2', 'pcb', '329', ''], - ['3', 'pcb', '329', ''], - ['4', 'pcb', '329', ''], - ['5', 'pcb', '1009', ''], - ['6', 'pcb', '329', ''], - ['7', 'pcb', '329', ''], - ['8', 'pcb', '329', ''], - ['9', 'pcb', '329', ''], - ['10', 'pcb', '1009', ''], - - ] + 'stprwrd': '1:b:329 2:b:329 3:b:329 4:b:329 5:b:1009 6:b:329 7:b:329 8:b:329 9:b:329 10:b:1009' } ] } + }, + 'bpls3sdvxfinal': { + 'type': 'comp', + 'info': { + 'id': 1, + 'data': { + "id": 1, + "compo": "stamp_complete_bpls3", + "requires": [ + { "id": 2129, "grades": [0] }, { "id": 2130, "grades": [0] }, { "id": 2131, "grades": [0] }, + { "id": 2132, "grades": [0] }, { "id": 2133, "grades": [0] }, { "id": 2134, "grades": [0] }, + { "id": 2135, "grades": [0] }, { "id": 2136, "grades": [0] }, { "id": 2137, "grades": [0] }, + { "id": 2138, "grades": [0] }, { "id": 2139, "grades": [0] }, { "id": 2140, "grades": [0] }, + { "id": 2141, "grades": [0] }, { "id": 2142, "grades": [0] }, { "id": 2143, "grades": [0] }, + { "id": 2144, "grades": [0] }, { "id": 2145, "grades": [0] }, { "id": 2146, "grades": [0] }, + { "id": 2147, "grades": [0] }, { "id": 2148, "grades": [0] }, { "id": 2149, "grades": [0] }, + { "id": 2151, "grades": [0] }, { "id": 2150, "grades": [0] }, { "id": 2152, "grades": [0] } + ], + "rewards":[ + { "id": 2151, "grades": [0, 1, 2, 4], "needStamp": 7 }, + { "id": 2150, "grades": [0, 1, 2, 4], "needStamp": 14 }, + { "id": 2152, "grades": [0, 1, 2, 4], "needStamp": 23 } + ] + } + } } } -export const EVENT_SONGS6 = { +export const EVENT_ITEMS6 = { // X-Record songs 'xrecord_1_1': ['1737'], 'xrecord_1_2': ['1738'], @@ -603,7 +461,9 @@ export const EVENT_SONGS6 = { // BPL S3 Triple Tribe 2 "bpls3tripletribe2_1": ['2162'], "bpls3tripletribe2_2": ['2163'], - "bpls3tripletribe2_3": ['2164'] + "bpls3tripletribe2_3": ['2164'], + // Mini Grace crew gift + "minigracegift": ['159'] } export const APRILFOOLSSONGS = [ diff --git a/sdvx@asphyxia/handlers/common.ts b/sdvx@asphyxia/handlers/common.ts index 1bad061..ea5f85e 100644 --- a/sdvx@asphyxia/handlers/common.ts +++ b/sdvx@asphyxia/handlers/common.ts @@ -194,21 +194,10 @@ export const common: EPR = async (info, data, send) => { let eventData = JSON.parse(bufEventData.toString()) let eventConfig = JSON.parse(bufEventConfig.toString()) for(const eventIter in eventData['events']) { + let stmpEvntInfo = STAMP_EVENTS6[eventData['events'][eventIter]['id']] if(eventData['events'][eventIter]['type'] === 'stamp' && eventConfig[eventData['events'][eventIter]['id']] !== undefined && eventConfig[eventData['events'][eventIter]['id']]['toggle']) { - let stmpEvntInfo = STAMP_EVENTS6[eventData['events'][eventIter]['id']] - let prmStr1Sel = '' - for(const stmpDataIter in stmpEvntInfo['info']['data']) { - let stmpRwrd = stmpEvntInfo['info']['data'][stmpDataIter]['stprwrd'] - let prmStr5 = '' - let sSheetName = (stmpRwrd[stmpRwrd.length - 1][1] === 'crew') ? stmpRwrd[stmpRwrd.length - 1][3] : stmpRwrd[stmpRwrd.length - 1][2] - prmStr1Sel += stmpEvntInfo['info']['data'][stmpDataIter]['stmpid'] + '#' + stmpEvntInfo['info']['data'][stmpDataIter]['bnr'] + '#' + itemTypeList[stmpRwrd[stmpRwrd.length - 1][1]] + '#' + sSheetName + (stmpEvntInfo['info']['data'].length - 1 === parseInt(stmpDataIter) ? '' : ',') - for(const stmpRwrdIter in stmpRwrd) { - let iID = stmpRwrd[stmpRwrdIter][2] - if (stmpRwrd[stmpRwrdIter][1] === 'track' || stmpRwrd[stmpRwrdIter][1] === 'prereq') iID += stmpRwrd[stmpRwrdIter][3] - prmStr5 += stmpRwrd[stmpRwrdIter][0] + ':' + itemTypeList[stmpRwrd[stmpRwrdIter][1]] + ':' + iID + (stmpRwrd.length - 1 === parseInt(stmpRwrdIter) ? '' : ' ') - } - let newSelMainExtend = { + extend.push({ 'type': 3, 'id': stmpEvntInfo['info']['data'][stmpDataIter]['stmpid'], 'params': [ @@ -221,14 +210,13 @@ export const common: EPR = async (info, data, send) => { stmpEvntInfo['info']['stmpHd'], '', stmpEvntInfo['info']['stmpFt'], - prmStr5 + stmpEvntInfo['info']['data'][stmpDataIter]['stprwrd'] ] - } - extend.push(newSelMainExtend) + }) } if(stmpEvntInfo['type'] === 'select') { - let newSelExtend = { + extend.push({ 'type': 3, 'id': stmpEvntInfo['info']['id'], 'params': [ @@ -237,16 +225,33 @@ export const common: EPR = async (info, data, send) => { 0, 0, 0, - prmStr1Sel, + stmpEvntInfo['info']['sheet'], '', stmpEvntInfo['info']['stmpSlHd'], stmpEvntInfo['info']['stmpSlFt'], stmpEvntInfo['info']['stmpBg'] ] - } - extend.push(newSelExtend) + }) } } + else if(eventData['events'][eventIter]['type'] === 'completestamp' && eventConfig[eventData['events'][eventIter]['id']] !== undefined && eventConfig[eventData['events'][eventIter]['id']]['toggle']) { + extend.push({ + 'type': 19, + 'id': stmpEvntInfo['info']['id'], + 'params': [ + 0, + 0, + 0, + 0, + 0, + JSON.stringify(stmpEvntInfo['info']['data']), + '', + '', + '', + '' + ] + }) + } } } diff --git a/sdvx@asphyxia/handlers/features.ts b/sdvx@asphyxia/handlers/features.ts index 1f6034e..87e1102 100644 --- a/sdvx@asphyxia/handlers/features.ts +++ b/sdvx@asphyxia/handlers/features.ts @@ -3,6 +3,7 @@ import { MusicRecord } from '../models/music_record'; import { Matchmaker } from '../models/matchmaker'; import { getVersion, IDToCode, GetCounter } from '../utils'; import { Mix } from '../models/mix'; +import { Rival } from '../models/rival'; export const hiscore: EPR = async (info, data, send) => { const records = await DB.Find(null, { collection: 'music' }); @@ -68,18 +69,18 @@ export const rival: EPR = async (info, data, send) => { if (!refid) return send.deny(); const rivals = ( - await DB.Find(null, { collection: 'profile' }) - ).filter(p => p.__refid != refid); + await DB.Find(refid, { collection: 'rival', mutual: true }) + ).filter(p => p.refid != refid); return send.object({ rival: await Promise.all( rivals.map(async (p, index) => { return { no: K.ITEM('s16', index), - seq: K.ITEM('str', IDToCode(p.id)), + seq: K.ITEM('str', IDToCode(p.sdvxID)), name: K.ITEM('str', p.name), music: ( - await DB.Find(p.__refid, { collection: 'music' }) + await DB.Find(p.refid, { collection: 'music' }) ).map(r => ({ // Changes were somehow made in the order of the field for the version 2023042500 param: K.ARRAY('u32', version < 2023042500 ? [r.mid, r.type, r.score, r.clear, r.grade] : [r.mid, r.type, r.score, r.exscore, r.clear, r.grade]), diff --git a/sdvx@asphyxia/handlers/profiles.ts b/sdvx@asphyxia/handlers/profiles.ts index 6a7071f..c155ba4 100644 --- a/sdvx@asphyxia/handlers/profiles.ts +++ b/sdvx@asphyxia/handlers/profiles.ts @@ -9,7 +9,7 @@ import { Profile } from '../models/profile'; import { ValgeneTicket } from '../models/valgene_ticket'; import { getVersion, IDToCode } from '../utils'; import { Mix } from '../models/mix'; -import { ARENA, EVENT_SONGS6 } from '../data/exg'; +import { ARENA, EVENT_ITEMS6 } from '../data/exg'; async function getAutomationMixes(params: Param[]) { const mixids = params @@ -657,22 +657,23 @@ export const load: EPR = async (info, data, send) => { let eventData = JSON.parse(bufEventData.toString()) let eventConfig = JSON.parse(bufEventConfig.toString()) for(const eventIter in eventData['events']) { - if(['gift', 'cross_online'].includes(eventData['events'][eventIter]['type']) && eventConfig[eventData['events'][eventIter]['id']] !== undefined) { + let typeIds = {'gift_crew': [11, 1], 'gift': [0, 23], 'cross_online': [0, 23]} + if(['gift_crew', 'gift', 'cross_online'].includes(eventData['events'][eventIter]['type']) && eventConfig[eventData['events'][eventIter]['id']] !== undefined) { if(typeof eventConfig[eventData['events'][eventIter]['id']]['toggle'] === "boolean") { if(eventConfig[eventData['events'][eventIter]['id']]['toggle']) { - for(const itemIter in EVENT_SONGS6[eventData['events'][eventIter]['id']]) { - let itemId = parseInt(EVENT_SONGS6[eventData['events'][eventIter]['id']][itemIter]) - if(await DB.Count(refid, {collection:'item', id: itemId}) === 0) { + for(const itemIter in EVENT_ITEMS6[eventData['events'][eventIter]['id']]) { + let itemId = parseInt(EVENT_ITEMS6[eventData['events'][eventIter]['id']][itemIter]) + if(await DB.Count(refid, {collection:'item', type: typeIds[eventData['events'][eventIter]['type']], id: itemId}) === 0) { await DB.Upsert( refid, - {collection: 'item', type: 0, id: itemId}, - {$set: { param: 23 }} + {collection: 'item', type: typeIds[eventData['events'][eventIter]['type']][0], id: itemId}, + {$set: { param: typeIds[eventData['events'][eventIter]['type']][1] }} ) presents.push({ id: itemId, - type: 0, - param: 23 + type: typeIds[eventData['events'][eventIter]['type']][0], + param: typeIds[eventData['events'][eventIter]['type']][1] }) } } @@ -680,19 +681,19 @@ export const load: EPR = async (info, data, send) => { } else{ for(const toggleKeys in Object.keys(eventConfig[eventData['events'][eventIter]['id']]['toggle'])) { if(eventConfig[eventData['events'][eventIter]['id']]['toggle'][Object.keys(eventConfig[eventData['events'][eventIter]['id']]['toggle'])[toggleKeys]]) { - for(const itemIter in EVENT_SONGS6[Object.keys(eventConfig[eventData['events'][eventIter]['id']]['toggle'])[toggleKeys]]) { - let itemId = parseInt(EVENT_SONGS6[Object.keys(eventConfig[eventData['events'][eventIter]['id']]['toggle'])[toggleKeys]][itemIter]) - if(await DB.Count(refid, {collection:'item', id: itemId}) === 0) { + for(const itemIter in EVENT_ITEMS6[Object.keys(eventConfig[eventData['events'][eventIter]['id']]['toggle'])[toggleKeys]]) { + let itemId = parseInt(EVENT_ITEMS6[Object.keys(eventConfig[eventData['events'][eventIter]['id']]['toggle'])[toggleKeys]][itemIter]) + if(await DB.Count(refid, {collection:'item', type: typeIds[eventData['events'][eventIter]['type']][0], id: itemId}) === 0) { await DB.Upsert( refid, - {collection: 'item', type: 0, id: itemId}, - {$set: { param: 23 }} + {collection: 'item', type: typeIds[eventData['events'][eventIter]['type']][0], id: itemId}, + {$set: { param: typeIds[eventData['events'][eventIter]['type']][1] }} ) presents.push({ id: itemId, - type: 0, - param: 23 + type: typeIds[eventData['events'][eventIter]['type']][0], + param: typeIds[eventData['events'][eventIter]['type']][1] }) } } @@ -751,7 +752,7 @@ export const load: EPR = async (info, data, send) => { const stampRD = profile.stampRD ? profile.stampRD : 0; const sysBG = profile.sysBG ? profile.sysBG : 0; const bplSupport = profile.bplSupport ? profile.bplSupport : 0; - + const creatorItem = profile.creatorItem ? profile.creatorItem : 0; const customize = []; customize.push(bgm, subbg, nemsys, stampA, stampB, stampC, stampD, stampRA, stampRB, stampRC, stampRD, sysBG); @@ -794,6 +795,7 @@ export const load: EPR = async (info, data, send) => { code: IDToCode(profile.id), arena, valgeneTicket, + creatorItem, ...profile, }); }; @@ -864,7 +866,8 @@ export const create: EPR = async (info, data, send) => { weekChain: 0, maxWeekChain: 0, - bplSupport: 0 + bplSupport: 0, + creatorItem: 0 }; await DB.Upsert(refid, { collection: 'profile' }, profile); diff --git a/sdvx@asphyxia/handlers/webui.ts b/sdvx@asphyxia/handlers/webui.ts index f503d85..d26623a 100644 --- a/sdvx@asphyxia/handlers/webui.ts +++ b/sdvx@asphyxia/handlers/webui.ts @@ -4,6 +4,7 @@ import { ValgeneTicket } from '../models/valgene_ticket'; import { Skill } from '../models/skill'; import { getVersion, IDToCode, GetCounter } from '../utils'; import { Mix } from '../models/mix'; +import { Rival } from '../models/rival'; import { PREGENE, COURSES6} from '../data/exg'; import { textureslist } from '../data/webui' import * as fs from 'fs'; @@ -29,6 +30,7 @@ export const updateProfile = async (data: { sysBG?: string; valgeneTicket?: string; skilltitle?: string; + creatorItem?: string; }) => { if (data.refid == null) return; @@ -117,6 +119,11 @@ export const updateProfile = async (data: { if (!_.isNaN(validSysBG)) update.sysBG = validSysBG; } + if (data.creatorItem && data.creatorItem.length > 0) { + const validCreatorItem = parseInt(data.creatorItem); + if (!_.isNaN(validCreatorItem)) update.creatorItem = validCreatorItem; + } + await DB.Update( data.refid, { collection: 'profile' }, @@ -222,7 +229,6 @@ export const deleteMix = async (data: { code: string }) => { await DB.Remove({ collection: 'mix', code: data.code }); }; - export const copyResourcesFromGame = async (data: {}, send: WebUISend) => { let mdbJsonFix = []; let mdbJsonFixFinal; @@ -703,11 +709,40 @@ export const copyResourcesFromGame = async (data: {}, send: WebUISend) => { ) } -export const preGeneRoll = async (data: { - set: number, - refid: string, - items: [] -}, send: WebUISend) => { +export const getRivalScores = async (data: { rivalId: string; refid: string; }, send: WebUISend) => { + let rival = await DB.FindOne(data.refid, {collection: 'rival', refid: data.rivalId}) + send.json({ + rival: await DB.FindOne(data.rivalId, {collection: 'profile'}), + yourScores: await DB.Find(data.refid, { collection: 'music' }), + rivalScores: await DB.Find(rival.refid, { collection: 'music' }) + }) +} + +export const addRival = async (data: { rivalId: string; refid: string; }, send: WebUISend) => { + let you = await DB.FindOne(data.refid, {collection: 'profile'}) + let rival = await DB.FindOne(data.rivalId, {collection: 'profile'}) + + let checkMutual = (await DB.Count(data.rivalId, {collection: 'rival', refid: data.refid}) > 0) + if(await DB.Count(data.refid, {collection: 'rival', refid: data.rivalId}) === 0) { + if(checkMutual) { + DB.Upsert(data.rivalId, {"collection": "rival", "sdvxID": you.id, "refid": data.refid, "name": you.name}, {$set: {"mutual": checkMutual}}) + } + DB.Insert(data.refid, {"collection": "rival", "sdvxID": rival.id, "refid": data.rivalId, "name": rival.name, "mutual": checkMutual}) + send.json({ + "msg": "Successfully added profile to rival. In order for your rivals to appear in-game, they need to add you as their rival as well." + }) + } else { + if(checkMutual) { + DB.Upsert(data.rivalId, {"collection": "rival", "sdvxID": you.id, "refid": data.refid, "name": you.name}, {$set: {"mutual": false}}) + } + DB.Remove(data.refid, {"collection": "rival", "sdvxID": rival.id, "refid": data.rivalId, "name": rival.name}) + send.json({ + "msg": "Successfully removed profile from rival." + }) + } +} + +export const preGeneRoll = async (data: { set: number, refid: string, items: [] }, send: WebUISend) => { let itemId = { 'crew': 11, @@ -777,14 +812,10 @@ export const preGeneRoll = async (data: { } else console.log('pregeneset none') } -export const manageEvents = async (data: { - eventConfig: {} -}) => { +export const manageEvents = async (data: { eventConfig: {} }) => { IO.WriteFile('webui/asset/config/events.json', JSON.stringify(data.eventConfig, null, 4)); } -export const manageStartupFlags = async (data: { - flagConfig: {} -}) => { +export const manageStartupFlags = async (data: { flagConfig: {} }) => { IO.WriteFile('webui/asset/config/flags.json', JSON.stringify(data.flagConfig, null, 4)); } \ No newline at end of file diff --git a/sdvx@asphyxia/index.ts b/sdvx@asphyxia/index.ts index a8901d6..d9eb76f 100644 --- a/sdvx@asphyxia/index.ts +++ b/sdvx@asphyxia/index.ts @@ -6,6 +6,8 @@ import { importMix, deleteMix, copyResourcesFromGame, + getRivalScores, + addRival, preGeneRoll, manageEvents, manageStartupFlags @@ -46,6 +48,8 @@ export function register() { // R.Config('new_year_special',{ type: 'boolean', default: false, name:'Use New Year Special', desc:'Enable New Year Special BGM for login.'}); R.WebUIEvent('copyResourcesFromGame', copyResourcesFromGame); + R.WebUIEvent('getRivalScores', getRivalScores); + R.WebUIEvent('addRival', addRival); R.WebUIEvent('preGeneRoll', preGeneRoll); R.WebUIEvent('manageEvents', manageEvents); R.WebUIEvent('manageStartupFlags', manageStartupFlags); diff --git a/sdvx@asphyxia/models/profile.ts b/sdvx@asphyxia/models/profile.ts index 8be2c74..3d258a6 100644 --- a/sdvx@asphyxia/models/profile.ts +++ b/sdvx@asphyxia/models/profile.ts @@ -60,4 +60,5 @@ export interface Profile { maxWeekChain: number; bplSupport: number; + creatorItem: number; } diff --git a/sdvx@asphyxia/models/rival.ts b/sdvx@asphyxia/models/rival.ts new file mode 100644 index 0000000..a50a9c2 --- /dev/null +++ b/sdvx@asphyxia/models/rival.ts @@ -0,0 +1,8 @@ +export interface Rival { + collection: 'rival'; + + sdvxID: number; + refid: string; + name: string; + mutual: boolean; +} diff --git a/sdvx@asphyxia/templates/load.pug b/sdvx@asphyxia/templates/load.pug index e33dbfa..92c5a3a 100644 --- a/sdvx@asphyxia/templates/load.pug +++ b/sdvx@asphyxia/templates/load.pug @@ -146,3 +146,10 @@ game valgene_ticket ticket_num(__type="s32") #{valgeneTicket.ticketNum} limit_date(__type="u64") #{valgeneTicket.limitDate} + + if creatorItem > 1 + creator_item + info + creator_type(__type="u32") #{creatorItem} + item_id(__type="u32") 0 + param(__type="u32") 0 diff --git a/sdvx@asphyxia/webui/asset/js/events.js b/sdvx@asphyxia/webui/asset/js/events.js index ca72c85..d87afa0 100644 --- a/sdvx@asphyxia/webui/asset/js/events.js +++ b/sdvx@asphyxia/webui/asset/js/events.js @@ -75,15 +75,15 @@ $(document).ready(async function() { } if(eventData['events'][eventIter]['enabled']) { - if(eventData['events'][eventIter]['type'] === 'stamp') { + if(/stamp|completestamp/.test(eventData['events'][eventIter]['type'])) { $('#stampevent_select').append( '' ) - } else if(eventData['events'][eventIter]['type'] === 'gift') { + } else if(/gift/.test(eventData['events'][eventIter]['type'])) { $('#giftevent_select').append( '' ) - } else if(eventData['events'][eventIter]['type'] === 'cross_online') { + } else if(/cross_online/.test(eventData['events'][eventIter]['type'])) { $('#crossevent_select').append( '' ) diff --git a/sdvx@asphyxia/webui/asset/js/preview.js b/sdvx@asphyxia/webui/asset/js/preview.js index 4cec553..85f8df9 100644 --- a/sdvx@asphyxia/webui/asset/js/preview.js +++ b/sdvx@asphyxia/webui/asset/js/preview.js @@ -239,8 +239,16 @@ $(document).ready(function() { })); } } - if(skill.length > 0) $('[name="skilltitle"]').val(skill[0]["name"]); - else $('[name="skilltitle"]').attr('disabled') + if(skill.length > 1) $('[name="skilltitle"]').val(skill[0]["name"]); + else $('[name="skilltitle"]').attr('disabled', 'disabled') + + for (var i in json["appeal_frame"]) { + $('[name="creatorItem"]').append($('