// // SecretRewardsLayer::showDialogMechanic from 0x588990 to 0x58912e (1950 bytes) // // 1 xrefs: // > SecretRewardsLayer::onShop @ 0x5897e8 // // This function is hookable on this platform! // // Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA // Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings // void SecretRewardsLayer::showDialogMechanic(SecretRewardsLayer *a1) { cocos2d::CCArray *v2; // r4 GameStatsManager *v3; // r0 const char *Stat; // r11 GameManager *v5; // r0 cocos2d::CCObject *v6; // r0 cocos2d::CCObject *v7; // r0 cocos2d::CCObject *v8; // r0 cocos2d::CCObject *v9; // r0 cocos2d::CCObject *v10; // r0 cocos2d::CCObject *v11; // r0 cocos2d::CCObject *v12; // r0 cocos2d::CCObject *v13; // r0 cocos2d::CCString *v14; // r0 char *CString; // r0 cocos2d::CCObject *v16; // r0 cocos2d::CCObject *v17; // r0 GameManager *v18; // r0 cocos2d::CCObject *v19; // r0 cocos2d::CCString *v20; // r0 char *v21; // r0 cocos2d::CCObject *v22; // r0 cocos2d::CCObject *v23; // r0 cocos2d::CCObject *v24; // r0 int v25; // r5 int v26; // r3 DialogLayer *v27; // r4 cocos2d::CCObject *v28; // r0 cocos2d::CCObject *v29; // r0 cocos2d::CCObject *v30; // r0 cocos2d::CCObject *v31; // r0 cocos2d::CCObject *v32; // r0 int v33; // [sp+4h] [bp-28h] int v34; // [sp+4h] [bp-28h] int v35; // [sp+4h] [bp-28h] int v36; // [sp+4h] [bp-28h] int v37; // [sp+4h] [bp-28h] int v38; // [sp+4h] [bp-28h] int v39; // [sp+4h] [bp-28h] int v40; // [sp+4h] [bp-28h] int v41; // [sp+4h] [bp-28h] int v42; // [sp+4h] [bp-28h] int v43; // [sp+4h] [bp-28h] int v44; // [sp+4h] [bp-28h] int v45; // [sp+4h] [bp-28h] int v46; // [sp+4h] [bp-28h] char v47; // [sp+1Ch] [bp-10h] BYREF _BYTE v48[4]; // [sp+20h] [bp-Ch] BYREF v2 = (cocos2d::CCArray *)cocos2d::CCArray::create((cocos2d::CCArray *)a1); v3 = GameStatsManager::sharedState(); Stat = (const char *)GameStatsManager::getStat(v3, "13"); if ( (int)Stat >= 2000 && (v5 = GameManager::sharedState(), GameManager::getUGV(v5, "36")) ) { sub_776584((int)&v47, "The Mechanic"); sub_776584((int)v48, "Now that's an impressive collection of Diamonds!"); LOWORD(v33) = -1; BYTE2(v33) = -1; v28 = (cocos2d::CCObject *)DialogObject::create( (DialogObject *)&v47, (std::string)v48, (std::string)39, 1065353216, 0.0, v33); cocos2d::CCArray::addObject(v2, v28); sub_774008(v48); sub_774008(&v47); sub_776584((int)&v47, "The Mechanic"); sub_776584((int)v48, "If anyone asks I didn't let you in."); LOWORD(v43) = -1; BYTE2(v43) = -1; v29 = (cocos2d::CCObject *)DialogObject::create( (DialogObject *)&v47, (std::string)v48, (std::string)37, 1065353216, 0.0, v43); cocos2d::CCArray::addObject(v2, v29); sub_774008(v48); sub_774008(&v47); sub_776584((int)&v47, "The Mechanic"); sub_776584((int)v48, "Scratch keeps trying to sneak past my security..."); LOWORD(v44) = -1; BYTE2(v44) = -1; v30 = (cocos2d::CCObject *)DialogObject::create( (DialogObject *)&v47, (std::string)v48, (std::string)50, 1065353216, 0.0, v44); cocos2d::CCArray::addObject(v2, v30); sub_774008(v48); sub_774008(&v47); sub_776584((int)&v47, "The Mechanic"); sub_776584((int)v48, "I CAN'T SEE!?"); LOWORD(v45) = -1; BYTE2(v45) = -1; v31 = (cocos2d::CCObject *)DialogObject::create( (DialogObject *)&v47, (std::string)v48, (std::string)44, 1065353216, 0.0, v45); cocos2d::CCArray::addObject(v2, v31); sub_774008(v48); sub_774008(&v47); sub_776584((int)&v47, "The Mechanic"); sub_776584((int)v48, "Ah sorry, my goggles were off.\nCome in."); LOWORD(v46) = -1; BYTE2(v46) = -1; v32 = (cocos2d::CCObject *)DialogObject::create( (DialogObject *)&v47, (std::string)v48, (std::string)51, 1065353216, 0.0, v46); cocos2d::CCArray::addObject(v2, v32); sub_774008(v48); sub_774008(&v47); v25 = 1; } else { switch ( a1->m_mechanicDialogIndex ) { case 0: sub_776584((int)&v47, "The Mechanic"); sub_776584((int)v48, "I'm in the middle of a job.\nCome back later."); LOWORD(v33) = -1; BYTE2(v33) = -1; v6 = (cocos2d::CCObject *)DialogObject::create( (DialogObject *)&v47, (std::string)v48, (std::string)38, 1065353216, 0.0, v33); cocos2d::CCArray::addObject(v2, v6); sub_774008(v48); sub_774008(&v47); sub_776584((int)&v47, "The Mechanic"); sub_776584((int)v48, "Can never get any peace and quiet in this game..."); LOWORD(v34) = -1; BYTE2(v34) = -1; v7 = (cocos2d::CCObject *)DialogObject::create( (DialogObject *)&v47, (std::string)v48, (std::string)37, 1065353216, 0.0, v34); cocos2d::CCArray::addObject(v2, v7); goto LABEL_9; case 1: sub_776584((int)&v47, "The Mechanic"); sub_776584((int)v48, "You again!? What now!?"); LOWORD(v33) = -1; BYTE2(v33) = -1; v8 = (cocos2d::CCObject *)DialogObject::create( (DialogObject *)&v47, (std::string)v48, (std::string)46, 1065353216, 0.0, v33); cocos2d::CCArray::addObject(v2, v8); sub_774008(v48); sub_774008(&v47); sub_776584((int)&v47, "The Mechanic"); sub_776584((int)v48, "I'm busy go bother someone else."); LOWORD(v35) = -1; BYTE2(v35) = -1; v9 = (cocos2d::CCObject *)DialogObject::create( (DialogObject *)&v47, (std::string)v48, (std::string)51, 1065353216, 0.0, v35); cocos2d::CCArray::addObject(v2, v9); sub_774008(v48); sub_774008(&v47); sub_776584((int)&v47, "The Mechanic"); sub_776584((int)v48, "You take one job then all of a sudden you're bugfixing the whole game."); LOWORD(v36) = -1; BYTE2(v36) = -1; v10 = (cocos2d::CCObject *)DialogObject::create( (DialogObject *)&v47, (std::string)v48, (std::string)37, 1065353216, 0.0, v36); cocos2d::CCArray::addObject(v2, v10); goto LABEL_9; case 2: sub_776584((int)&v47, "The Mechanic"); sub_776584((int)v48, "Hmm so if I push here... maybe..."); LOWORD(v33) = -1; BYTE2(v33) = -1; v11 = (cocos2d::CCObject *)DialogObject::create( (DialogObject *)&v47, (std::string)v48, (std::string)45, 1065353216, 0.0, v33); cocos2d::CCArray::addObject(v2, v11); sub_774008(v48); sub_774008(&v47); sub_776584((int)&v47, "The Mechanic"); sub_776584((int)v48, "No, still broken..."); LOWORD(v37) = -1; BYTE2(v37) = -1; v12 = (cocos2d::CCObject *)DialogObject::create( (DialogObject *)&v47, (std::string)v48, (std::string)49, 1065353216, 0.0, v37); cocos2d::CCArray::addObject(v2, v12); goto LABEL_9; case 3: sub_776584((int)&v47, "The Mechanic"); sub_776584((int)v48, "I have enough work as it is, can't go around helping everyone."); LOWORD(v33) = -1; BYTE2(v33) = -1; v13 = (cocos2d::CCObject *)DialogObject::create( (DialogObject *)&v47, (std::string)v48, (std::string)51, 1065353216, 0.0, v33); cocos2d::CCArray::addObject(v2, v13); sub_774008(v48); sub_774008(&v47); sub_776584((int)&v47, "The Mechanic"); v14 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat( (cocos2d::CCString *)"Collect %i Diamonds so I know you're legit, then we can talk.", (const char *)&stru_7CC.st_value); CString = (char *)cocos2d::CCString::getCString(v14); sub_776584((int)v48, CString); LOWORD(v38) = -1; BYTE2(v38) = -1; v16 = (cocos2d::CCObject *)DialogObject::create( (DialogObject *)&v47, (std::string)v48, (std::string)37, 1065353216, 0.0, v38); cocos2d::CCArray::addObject(v2, v16); sub_774008(v48); sub_774008(&v47); sub_776584((int)&v47, "The Mechanic"); sub_776584((int)v48, "Who ordered this thing it doesn't even fit..."); LOWORD(v39) = -1; BYTE2(v39) = -1; v17 = (cocos2d::CCObject *)DialogObject::create( (DialogObject *)&v47, (std::string)v48, (std::string)49, 1065353216, 0.0, v39); cocos2d::CCArray::addObject(v2, v17); sub_774008(v48); sub_774008(&v47); v18 = GameManager::sharedState(); GameManager::setUGV(v18, "36", 1); break; case 4: sub_776584((int)&v47, "The Mechanic"); sub_776584((int)v48, "Scanning user..."); LOWORD(v33) = -1; BYTE2(v33) = -1; v19 = (cocos2d::CCObject *)DialogObject::create( (DialogObject *)&v47, (std::string)v48, (std::string)49, 1065353216, 0.0, v33); cocos2d::CCArray::addObject(v2, v19); sub_774008(v48); sub_774008(&v47); sub_776584((int)&v47, "The Mechanic"); v20 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat( (cocos2d::CCString *)"Scan complete.\n" "Diamonds: %i, Required: %i", Stat, 2000); v21 = (char *)cocos2d::CCString::getCString(v20); sub_776584((int)v48, v21); LOWORD(v40) = -1; BYTE2(v40) = -1; v22 = (cocos2d::CCObject *)DialogObject::create( (DialogObject *)&v47, (std::string)v48, (std::string)45, 1065353216, 0.0, v40); cocos2d::CCArray::addObject(v2, v22); sub_774008(v48); sub_774008(&v47); sub_776584((int)&v47, "The Mechanic"); sub_776584((int)v48, "Hey who are you trying to fool?!"); LOWORD(v41) = -1; BYTE2(v41) = -1; v23 = (cocos2d::CCObject *)DialogObject::create( (DialogObject *)&v47, (std::string)v48, (std::string)46, 1065353216, 0.0, v41); cocos2d::CCArray::addObject(v2, v23); sub_774008(v48); sub_774008(&v47); sub_776584((int)&v47, "The Mechanic"); sub_776584( (int)v48, "Come back when you have\ncollected more Diamonds..."); LOWORD(v42) = -1; BYTE2(v42) = -1; v24 = (cocos2d::CCObject *)DialogObject::create( (DialogObject *)&v47, (std::string)v48, (std::string)50, 1065353216, 0.0, v42); cocos2d::CCArray::addObject(v2, v24); LABEL_9: sub_774008(v48); sub_774008(&v47); break; default: break; } v25 = 0; v26 = a1->m_mechanicDialogIndex + 1; if ( v26 > 4 ) a1->m_mechanicDialogIndex = 0; else a1->m_mechanicDialogIndex = v26; } v27 = DialogLayer::createWithObjects(v2, (int)byte_4); a1->addChild_0(a1, v27, 100); v27->setTag(v27, 4); if ( v25 ) v27->m_delegate = &a1->DialogDelegate; DialogLayer::updateChatPlacement(v27, Center); DialogLayer::animateInRandomSide(v27); }
GD Web Decomp Icon

GD Web Decomp

Raw Source