Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void __cdecl MerchantRoomInit()
- {
- uint16_t curRoomId_1C; // ax
- Flags_SCENARIO_1 v1; // eax
- Flags_SCENARIO_1 v2; // eax
- uint16_t v3; // ax
- uint16_t v4; // ax
- if ( (pG->Flags_SYSTEM_0_54[0] & SYS_PS2_ADA_GAME) != 0 )
- {
- MerchantRoomInit_Ada();
- }
- else
- {
- merchantChar.m_p_info_0 = &merchant_info_A;
- merchantChar.m_p_data_4 = merchantData;
- merchantChar.m_p_sell_8 = g_item_price_tbl;
- merchantChar.m_p_exer_C = g_item_price_tbl;
- merchantChar.m_p_lvup_10 = level_price;
- curRoomId_1C = pG->SaveWk_4F90.curRoomId_1C;
- switch ( curRoomId_1C )
- {
- case 0x102u:
- if ( !j_cRoomData::checkPassed(&RoomData, curRoomId_1C, 0) )
- {
- j_levelDataAdd(merchantData, level_styer, 0);
- j_stockDataAdd(merchantData, stock_r102, 0);
- }
- break;
- case 0x104u:
- if ( !j_cRoomData::checkPassed(&RoomData, curRoomId_1C, 0) )
- {
- j_levelDataAdd(merchantData, level_first, 0);
- j_stockDataAdd(merchantData, stock_r104, 0);
- }
- break;
- case 0x10Du:
- if ( !j_cRoomData::checkPassed(&RoomData, curRoomId_1C, 0) )
- {
- j_levelDataAdd(merchantData, level_null, 0);
- j_stockDataAdd(merchantData, stock_r10d, 0);
- }
- break;
- case 0x10Fu:
- if ( !j_cRoomData::checkPassed(&RoomData, curRoomId_1C, 0) )
- {
- j_levelDataAdd(merchantData, level_null, 0);
- j_stockDataAdd(merchantData, stock_r10f, 0);
- }
- break;
- case 0x112u:
- if ( !j_cRoomData::checkPassed(&RoomData, curRoomId_1C, 0) )
- {
- j_levelDataAdd(merchantData, level_r112, 0);
- j_stockDataAdd(merchantData, stock_r112, 0);
- }
- break;
- default:
- break;
- }
- if ( pG->SaveWk_4F90.curRoomId_1C == 0x10E )
- {
- v1 = pG->SaveWk_4F90.Flags_SCENARIO_1_340[0];
- if ( (v1 & SCF_ST1_NIGHT) != 0 )
- {
- if ( (v1 & SCF_R10E_STOCK_NIGHT) == 0 )
- {
- j_levelDataAdd(merchantData, level_null, 0);
- j_stockDataAdd(merchantData, stock_r10e_night, 0);
- pG->SaveWk_4F90.Flags_SCENARIO_1_340[0] |= SCF_R10E_STOCK_NIGHT;
- }
- }
- else if ( (v1 & SCF_R10E_STOCK_DAY) == 0 )
- {
- j_levelDataAdd(merchantData, level_r10e_day, 0);
- j_stockDataAdd(merchantData, stock_r10e_day, 0);
- pG->SaveWk_4F90.Flags_SCENARIO_1_340[0] |= SCF_R10E_STOCK_DAY;
- }
- }
- v2 = pG->SaveWk_4F90.Flags_SCENARIO_1_340[0];
- if ( (v2 & SCF_ST1_NIGHT) != 0 && (v2 & SCF_ST1_NIGHT_LV_ADD) == 0 )
- {
- j_levelDataAdd(merchantData, level_r10e_day, 0);
- j_levelDataAdd(merchantData, level_1st_night, 0);
- pG->SaveWk_4F90.Flags_SCENARIO_1_340[0] |= SCF_ST1_NIGHT_LV_ADD;
- }
- v3 = pG->SaveWk_4F90.curRoomId_1C;
- switch ( v3 )
- {
- case 0x202u:
- if ( !j_cRoomData::checkPassed(&RoomData, v3, 0) )
- {
- j_levelDataAdd(merchantData, level_r202, 0);
- goto LABEL_46;
- }
- break;
- case 0x204u:
- if ( !j_cRoomData::checkPassed(&RoomData, v3, 0) )
- {
- j_levelDataAdd(merchantData, level_r204, 0);
- goto LABEL_46;
- }
- break;
- case 0x20Bu:
- if ( !j_cRoomData::checkPassed(&RoomData, v3, 0) )
- {
- j_levelDataAdd(merchantData, level_r20b, 0);
- goto LABEL_46;
- }
- break;
- case 0x20Fu:
- if ( !j_cRoomData::checkPassed(&RoomData, v3, 0) )
- {
- j_levelDataAdd(merchantData, level_null, 0);
- j_stockDataAdd(merchantData, stock_r20f, 0);
- }
- break;
- case 0x211u:
- if ( !j_cRoomData::checkPassed(&RoomData, v3, 0) )
- {
- j_levelDataAdd(merchantData, level_r211, 0);
- goto LABEL_46;
- }
- break;
- case 0x214u:
- if ( !j_cRoomData::checkPassed(&RoomData, v3, 0) )
- {
- j_levelDataAdd(merchantData, level_r214, 0);
- goto LABEL_46;
- }
- break;
- case 0x220u:
- if ( !j_cRoomData::checkPassed(&RoomData, v3, 0) )
- {
- j_levelDataAdd(merchantData, level_r220, 0);
- goto LABEL_46;
- }
- break;
- case 0x225u:
- if ( !j_cRoomData::checkPassed(&RoomData, v3, 0) )
- {
- j_levelDataAdd(merchantData, level_r225, 0);
- goto LABEL_46;
- }
- break;
- case 0x227u:
- if ( !j_cRoomData::checkPassed(&RoomData, v3, 0) )
- {
- j_levelDataAdd(merchantData, level_r227, 0);
- goto LABEL_46;
- }
- break;
- case 0x229u:
- if ( !j_cRoomData::checkPassed(&RoomData, v3, 0) )
- {
- j_levelDataAdd(merchantData, level_r229, 0);
- j_stockDataAdd(merchantData, stock_r229, 0);
- }
- break;
- case 0x22Au:
- if ( !j_cRoomData::checkPassed(&RoomData, v3, 0) )
- {
- j_levelDataAdd(merchantData, level_r22a, 0);
- LABEL_46:
- j_stockDataAdd(merchantData, stock_2st_general, 0);
- }
- break;
- default:
- break;
- }
- v4 = pG->SaveWk_4F90.curRoomId_1C;
- switch ( v4 )
- {
- case 0x301u:
- if ( !j_cRoomData::checkPassed(&RoomData, v4, 0) )
- {
- j_levelDataAdd(merchantData, level_r301, 0);
- j_stockDataAdd(merchantData, stock_r301, 0);
- }
- break;
- case 0x305u:
- if ( !j_cRoomData::checkPassed(&RoomData, v4, 0) )
- {
- j_levelDataAdd(merchantData, level_r305, 0);
- j_stockDataAdd(merchantData, stock_r305, 0);
- }
- break;
- case 0x30Au:
- case 0x312u:
- case 0x315u:
- case 0x331u:
- if ( !j_cRoomData::checkPassed(&RoomData, v4, 0) )
- {
- j_levelDataAdd(merchantData, level_null, 0);
- goto LABEL_60;
- }
- break;
- case 0x31Au:
- if ( !j_cRoomData::checkPassed(&RoomData, v4, 0) )
- {
- j_levelDataAdd(merchantData, level_r31a, 0);
- goto LABEL_60;
- }
- break;
- case 0x31Du:
- if ( !j_cRoomData::checkPassed(&RoomData, v4, 0) )
- {
- j_levelDataAdd(merchantData, level_r31d, 0);
- goto LABEL_60;
- }
- break;
- case 0x329u:
- if ( !j_cRoomData::checkPassed(&RoomData, v4, 0) )
- {
- j_levelDataAdd(merchantData, level_r329, 0);
- LABEL_60:
- j_stockDataAdd(merchantData, stock_3st_general, 0);
- }
- break;
- default:
- break;
- }
- if ( pG->SaveWk_4F90.game_cnt_E )
- {
- j_levelDataAdd(merchantData, level_ext_normal, 1u);
- j_stockDataAdd(merchantData, stock_ext_normal, 1u);
- if ( (pSys->Flags_EXTRA_4[0] & EXT_GET_SW500) != 0 )
- {
- j_levelDataAdd(merchantData, level_ext_sw500, 2u);
- j_stockDataAdd(merchantData, stock_ext_sw500, 2u);
- }
- if ( (pSys->Flags_EXTRA_4[0] & EXT_GET_TOMPSON) != 0 )
- j_stockDataAdd(merchantData, stock_ext_tompson, 2u);
- if ( (pSys->Flags_EXTRA_4[0] & EXT_GET_LASER) != 0 )
- j_stockDataAdd(merchantData, stock_ext_laser, 2u);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement