// // GJChestSprite::switchToState from 0x936c44 to 0x937aa8 (3684 bytes) // // 11 xrefs: // > RewardUnlockLayer::step2 @ 0x937b48 // > GJChestSprite::init @ 0x937c78 // > RewardUnlockLayer::playRewardEffect @ 0x938d98 // > SecretLayer3::init @ 0x9457dc // > SecretLayer3::init @ 0x945a10 // > SecretLayer4::init @ 0x94afb4 // > FollowRewardPage::switchToOpenedState @ 0x963a04 // > FollowRewardPage::init @ 0x96406c // > SecretRewardsLayer::switchToOpenedState @ 0xa61630 // > SecretRewardsLayer::generateChestItems @ 0xa6a424 // > @ 0x83fa0 // // 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 GJChestSprite::switchToState(GJChestSprite *a1, ChestSpriteState a2, bool a3) { _BOOL4 v3; // w23 GJChestSprite_vtbl *v5; // x2 int m_chestType; // w0 float v7; // s8 char *v8; // x0 cocos2d::CCSprite *v9; // x0 cocos2d::CCSprite *v10; // x0 char *v11; // x0 cocos2d::CCSprite *v12; // x19 char *v13; // x0 unsigned int *v14; // x19 int v15; // w1 const char *RewardFrame; // x0 cocos2d::CCSprite *v17; // x0 char *v18; // x0 cocos2d::CCSprite *v19; // x0 cocos2d::CCSprite *v20; // x0 char *v21; // x0 unsigned int *v22; // x19 cocos2d::CCSprite *v23; // x22 cocos2d::CCSprite *v24; // x23 void (__fastcall *v25)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x24 float v26; // s9 __int64 v27; // x0 bool v28; // w2 cocos2d::CCParticleSystem *v29; // x22 int v30; // w0 float v31; // s1 int v32; // w19 int v33; // w23 int v34; // w24 float v35; // s2 void (__fastcall *v36)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // x2 void (__fastcall *v37)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // x2 void (__fastcall *v38)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x19 char *v39; // x0 unsigned int *v40; // x1 int v41; // w2 cocos2d::CCSprite *v42; // x22 cocos2d::CCFadeTo *v43; // x0 cocos2d::CCEaseInOut *v44; // x23 cocos2d::CCFadeTo *v45; // x0 cocos2d::CCEaseInOut *v46; // x0 cocos2d::CCActionInterval *v47; // x0 cocos2d::CCRepeatForever *v48; // x0 int v49; // w0 int v50; // w23 int v51; // w25 int v52; // w24 cocos2d::CCSprite *v53; // x22 void (__fastcall *setPosition)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x28 float v55; // s11 cocos2d::CCRotateBy *v56; // x0 cocos2d::CCActionInterval *v57; // x0 cocos2d::CCRepeatForever *v58; // x0 cocos2d::CCSprite *v59; // x22 void (__fastcall *v60)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x26 cocos2d::CCRotateBy *v61; // x0 cocos2d::CCActionInterval *v62; // x0 cocos2d::CCRepeatForever *v63; // x0 bool v64; // w2 cocos2d::CCParticleSystem *v65; // x22 void (__fastcall *v66)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x26 void (__fastcall *setStartColor)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // x2 void (__fastcall *setEndColor)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // x2 cocos2d::CCSprite *v69; // x22 cocos2d::CCSprite *v70; // x22 cocos2d::CCSprite *v71; // x22 void (__fastcall *v72)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x24 cocos2d::CCSprite *v73; // x22 void (__fastcall *v74)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x23 char *p_m_fBrVertexMod; // x0 unsigned int *p_m_fTextureTop; // x1 int m_fTextureTop_low; // w2 unsigned int *v78; // x1 int v79; // w2 unsigned int *v80; // x1 int v81; // w2 int v82; // [xsp+84h] [xbp+84h] int v84; // [xsp+88h] [xbp+88h] char v85; // [xsp+98h] [xbp+98h] BYREF char v86; // [xsp+99h] [xbp+99h] char v87; // [xsp+9Ah] [xbp+9Ah] char v88; // [xsp+A0h] [xbp+A0h] BYREF char v89; // [xsp+A1h] [xbp+A1h] char v90; // [xsp+A2h] [xbp+A2h] _BYTE v91[8]; // [xsp+A8h] [xbp+A8h] BYREF cocos2d::CCSprite *v92; // [xsp+B0h] [xbp+B0h] BYREF cocos2d::CCSprite *v93; // [xsp+B8h] [xbp+B8h] BYREF cocos2d::CCSprite *v94; // [xsp+C0h] [xbp+C0h] BYREF cocos2d::CCPoint v95; // [xsp+C8h] [xbp+C8h] BYREF float v96; // [xsp+D0h] [xbp+D0h] float v97; // [xsp+D4h] [xbp+D4h] v3 = a3; if ( a1->m_spriteState == a2 ) return; v5 = a1->cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable; a1->m_spriteState = a2; ((void (*)(void))v5->removeAllChildren)(); m_chestType = a1->m_chestType; if ( m_chestType == 1 ) { v7 = 0.8; if ( a2 != Opening ) { LABEL_4: if ( a2 != Opened ) { if ( a2 == Closed ) { RewardFrame = RewardsPage::getRewardFrame(m_chestType, 2); v17 = cocos2d::CCSprite::createWithSpriteFrameName(RewardFrame); a1->addChild_0(a1, v17, 3); } return; } v18 = (char *)RewardsPage::getRewardFrame(m_chestType, 4); sub_D153B8((int)&v92, v18); v19 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v92); a1->addChild_0(a1, v19, 4); sub_934CB4((char *)v92, "_back_001", (__int64)&v93); v20 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v93); a1->addChild_0(a1, v20, 0); if ( !v3 ) { sub_934CB4((char *)v92, "_glow_001", (__int64)&v94); v42 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v94); a1->addChild_0(a1, v42, 1); ((void (__fastcall *)(cocos2d::CCSprite *, __int64))v42->setBlendFunc)(v42, 0x100000302LL); v43 = cocos2d::CCFadeTo::create(1.0, 0xAFu); v44 = cocos2d::CCEaseInOut::create(v43, 2.0); v45 = cocos2d::CCFadeTo::create(1.0, 0xFFu); v46 = cocos2d::CCEaseInOut::create(v45, 2.0); v47 = (cocos2d::CCActionInterval *)cocos2d::CCSequence::create((cocos2d::CCSequence *)v44, v46, 0); v48 = cocos2d::CCRepeatForever::create(v47); cocos2d::CCNode::runAction(v42, v48); v49 = a1->m_chestType; v87 = -1; v90 = -1; qmemcpy(v91, "3D", 2); v85 = 0; v86 = -106; v88 = 0; v89 = -106; v91[2] = -103; switch ( v49 ) { case 1: v52 = 255; v85 = -1; v86 = -56; v51 = 100; v87 = 0; v50 = 0; v88 = -1; v84 = 255; v90 = 0; v82 = 255; break; case 2: case 5: v50 = 255; v86 = -56; v51 = 0; v52 = 0; v89 = 100; v84 = 255; v82 = 0; break; case 4: v86 = -1; v89 = -1; v51 = 255; v90 = 50; v87 = 0; v52 = 0; v50 = 0; v84 = 255; v82 = 150; break; case 6: v86 = -56; v89 = 100; qmemcpy(v91, "\n6S", 3); v50 = 255; v51 = 0; v52 = 0; v84 = 255; v82 = 0; break; case 7: v86 = -1; v89 = -1; v90 = 50; v82 = 150; qmemcpy(v91, ")Q;", 3); v51 = 255; v52 = 100; v87 = 0; v50 = 0; v84 = 255; break; case 8: v85 = -1; v88 = -1; v84 = 150; v52 = 255; v91[0] = 58; v86 = 0; v91[1] = 27; v51 = 0; v50 = 255; v89 = 0; v82 = 255; v91[2] = 75; break; case 9: v85 = -1; v88 = -1; v91[0] = 39; v52 = 255; v91[1] = 29; v51 = 100; v86 = -56; v50 = 0; v87 = 0; v84 = 255; v82 = 255; v90 = 0; v91[2] = 44; break; default: v50 = 255; v51 = 0; v52 = 0; v84 = 255; v82 = 0; break; } v53 = cocos2d::CCSprite::createWithSpriteFrameName("shineBurst_001.png"); a1->addChild_0(a1, v53, 1); ((void (__fastcall *)(cocos2d::CCSprite *, __int64))v53->setBlendFunc)(v53, 0x100000302LL); setPosition = v53->setPosition; cocos2d::CCPoint::CCPoint(&v95, 0.0, -5.0); setPosition(v53, &v95); v53->setScale(v53, v7 * 4.0); v53->setColor(v53, (const cocos2d::ccColor3B *)&v85); if ( (float)((float)rand() * 4.6566e-10) > 0.5 ) v55 = 1.0; else v55 = -1.0; v56 = (cocos2d::CCRotateBy *)rand(); v57 = (cocos2d::CCActionInterval *)cocos2d::CCRotateBy::create( v56, 1.0, v55 * (float)((float)((float)((float)((float)(int)v56 * 4.6566e-10) * 0.5) + 0.5) * 180.0)); v58 = cocos2d::CCRepeatForever::create(v57); cocos2d::CCNode::runAction(v53, v58); v59 = cocos2d::CCSprite::createWithSpriteFrameName("shineBurst_001.png"); a1->addChild_0(a1, v59, 1); ((void (__fastcall *)(cocos2d::CCSprite *, __int64))v59->setBlendFunc)(v59, 0x100000302LL); v60 = v59->setPosition; cocos2d::CCPoint::CCPoint(&v95, 0.0, -5.0); v60(v59, &v95); v59->setScale(v59, v7 * 3.5); v59->setColor(v59, (const cocos2d::ccColor3B *)&v88); v61 = (cocos2d::CCRotateBy *)rand(); v62 = (cocos2d::CCActionInterval *)cocos2d::CCRotateBy::create( v61, 1.0, (float)((float)((float)((float)((float)(int)v61 * 4.6566e-10) * 0.5) + 0.5) * 180.0) * (float)-v55); v63 = cocos2d::CCRepeatForever::create(v62); cocos2d::CCNode::runAction(v59, v63); v65 = (cocos2d::CCParticleSystem *)cocos2d::CCParticleSystemQuad::create( (cocos2d::CCParticleSystemQuad *)"chestOpened.plist", nullptr, v64); v65->setAutoRemoveOnFinish(v65, 1); a1->addChild_0(a1, v65, 1); v66 = v65->setPosition; cocos2d::CCPoint::CCPoint(&v95, 0.0, 0.0); v66(v65, &v95); setStartColor = v65->setStartColor; v97 = 1.0; v96 = (float)v50 / 255.0; v95.x = (float)v82 / 255.0; v95.y = (float)v84 / 255.0; setStartColor(v65, (const cocos2d::ccColor4F *)&v95); setEndColor = v65->setEndColor; v96 = (float)v50 / 255.0; v97 = 1.0; v95.x = (float)v52 / 255.0; v95.y = (float)v51 / 255.0; setEndColor(v65, (const cocos2d::ccColor4F *)&v95); v65->setScale(v65, v7); cocos2d::CCParticleSystem::resetSystem(v65); v69 = cocos2d::CCSprite::createWithSpriteFrameName("chest_glow_bg_001.png"); a1->addChild_0(a1, v69, 2); v69->setScale(v69, v7); v69->setColor(v69, (const cocos2d::ccColor3B *)v91); v70 = cocos2d::CCSprite::createWithSpriteFrameName("chest_glow_bg_001.png"); cocos2d::CCSprite::setFlipX(v70, 1); a1->addChild_0(a1, v70, 2); v70->setScale(v70, v7); v70->setColor(v70, (const cocos2d::ccColor3B *)v91); v71 = cocos2d::CCSprite::createWithSpriteFrameName("whiteSquare60_001.png"); v72 = v71->setPosition; cocos2d::CCPoint::CCPoint(&v95, 0.0, v7 * -52.0); v72(v71, &v95); v71->setScaleX(v71, v7 * 5.2); v71->setScaleY(v71, v7 * 2.2); v71->setColor(v71, (const cocos2d::ccColor3B *)v91); a1->addChild_0(a1, v71, 2); v73 = cocos2d::CCSprite::createWithSpriteFrameName("chest_shadow_001.png"); v74 = v73->setPosition; cocos2d::CCPoint::CCPoint(&v95, 0.0, v7 * -48.0); v74(v73, &v95); a1->addChild_0(a1, v73, 3); v73->setScale(v73, v7 * 0.95); v73->setOpacity(v73, 90); p_m_fBrVertexMod = (char *)&v94[-1].m_fBrVertexMod; if ( (__int64 *)&v94[-1].m_fBrVertexMod != &qword_124B6B0 ) { if ( &pthread_create ) { p_m_fTextureTop = (unsigned int *)&v94[-1].m_fTextureTop; do m_fTextureTop_low = __ldaxr(p_m_fTextureTop); while ( __stlxr(m_fTextureTop_low - 1, p_m_fTextureTop) ); } else { m_fTextureTop_low = LODWORD(v94[-1].m_fTextureTop); LODWORD(v94[-1].m_fTextureTop) = m_fTextureTop_low - 1; } if ( m_fTextureTop_low <= 0 ) operator delete(p_m_fBrVertexMod); } } v21 = (char *)&v93[-1].m_fBrVertexMod; if ( (__int64 *)&v93[-1].m_fBrVertexMod != &qword_124B6B0 ) { if ( &pthread_create ) { v80 = (unsigned int *)&v93[-1].m_fTextureTop; do v81 = __ldaxr(v80); while ( __stlxr(v81 - 1, v80) ); } else { v81 = LODWORD(v93[-1].m_fTextureTop); LODWORD(v93[-1].m_fTextureTop) = v81 - 1; } if ( v81 <= 0 ) operator delete(v21); } v12 = v92; v13 = (char *)&v92[-1].m_fBrVertexMod; if ( (__int64 *)&v92[-1].m_fBrVertexMod != &qword_124B6B0 ) { if ( &pthread_create ) { v22 = (unsigned int *)&v92[-1].m_fTextureTop; do v15 = __ldaxr(v22); while ( __stlxr(v15 - 1, v22) ); goto LABEL_15; } goto LABEL_64; } return; } } else { v7 = 1.0; if ( a2 != Opening ) goto LABEL_4; } v8 = (char *)RewardsPage::getRewardFrame(m_chestType, a2); sub_D153B8((int)&v92, v8); v9 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v92); a1->addChild_0(a1, v9, 3); sub_934CB4((char *)v92, "_back_001", (__int64)&v93); v10 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v93); a1->addChild_0(a1, v10, 0); if ( !v3 ) { sub_934CB4((char *)v92, "_glow_001", (__int64)&v94); v23 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v94); a1->addChild_0(a1, v23, 1); v24 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v94); v23->addChild_0(v23, v24, 1); v25 = v24->setPosition; v26 = v23->getContentSize(v23)->width * 0.5; v27 = (__int64)v23->getContentSize(v23); cocos2d::CCPoint::CCPoint(&v95, v26, *(float *)(v27 + 4) * 0.5); v25(v24, &v95); v24->setScaleX(v24, 0.8); ((void (__fastcall *)(cocos2d::CCSprite *, __int64))v23->setBlendFunc)(v23, 0x100000302LL); ((void (__fastcall *)(cocos2d::CCSprite *, __int64))v24->setBlendFunc)(v24, 0x100000302LL); v29 = (cocos2d::CCParticleSystem *)cocos2d::CCParticleSystemQuad::create( (cocos2d::CCParticleSystemQuad *)"chestOpen.plist", nullptr, v28); v29->setAutoRemoveOnFinish(v29, 1); a1->addChild_0(a1, v29, 4); v30 = a1->m_chestType; switch ( v30 ) { case 1: v31 = 0.19608; v32 = 0; v35 = 1.0; v33 = 0; v34 = 255; break; case 3: v31 = 1.0; v32 = 255; v35 = 0.0; v33 = 0; v34 = 0; break; case 4: v31 = 0.0; v32 = 0; v35 = 0.58824; v33 = 255; v34 = 0; break; default: v31 = 1.0; v32 = 255; v33 = 255; v34 = 0; v35 = 1.0; break; } v36 = v29->setStartColor; v95.x = v35; v95.y = 1.0; v96 = v31; v97 = 1.0; v36(v29, (const cocos2d::ccColor4F *)&v95); v37 = v29->setEndColor; v97 = 1.0; v95.x = (float)v34 / 255.0; v95.y = (float)v33 / 255.0; v96 = (float)v32 / 255.0; v37(v29, (const cocos2d::ccColor4F *)&v95); v29->setScale(v29, v7); v38 = v29->setPosition; cocos2d::CCPoint::CCPoint(&v95, 0.0, 0.0); v38(v29, &v95); cocos2d::CCParticleSystem::resetSystem(v29); v39 = (char *)&v94[-1].m_fBrVertexMod; if ( (__int64 *)&v94[-1].m_fBrVertexMod != &qword_124B6B0 ) { if ( &pthread_create ) { v40 = (unsigned int *)&v94[-1].m_fTextureTop; do v41 = __ldaxr(v40); while ( __stlxr(v41 - 1, v40) ); } else { v41 = LODWORD(v94[-1].m_fTextureTop); LODWORD(v94[-1].m_fTextureTop) = v41 - 1; } if ( v41 <= 0 ) operator delete(v39); } } v11 = (char *)&v93[-1].m_fBrVertexMod; if ( (__int64 *)&v93[-1].m_fBrVertexMod != &qword_124B6B0 ) { if ( &pthread_create ) { v78 = (unsigned int *)&v93[-1].m_fTextureTop; do v79 = __ldaxr(v78); while ( __stlxr(v79 - 1, v78) ); } else { v79 = LODWORD(v93[-1].m_fTextureTop); LODWORD(v93[-1].m_fTextureTop) = v79 - 1; } if ( v79 <= 0 ) operator delete(v11); } v12 = v92; v13 = (char *)&v92[-1].m_fBrVertexMod; if ( (__int64 *)&v92[-1].m_fBrVertexMod != &qword_124B6B0 ) { if ( &pthread_create ) { v14 = (unsigned int *)&v92[-1].m_fTextureTop; do v15 = __ldaxr(v14); while ( __stlxr(v15 - 1, v14) ); LABEL_15: if ( v15 <= 0 ) operator delete(v13); return; } LABEL_64: v15 = LODWORD(v12[-1].m_fTextureTop); LODWORD(v12[-1].m_fTextureTop) = v15 - 1; goto LABEL_15; } }
GD Web Decomp Icon

GD Web Decomp

Raw Source