// // PlayLayer::destroyPlayer from 0x313ccc to 0x3142b8 (1516 bytes) // // 0 xrefs: // // 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 PlayLayer::destroyPlayer(PlayLayer *a1, PlayerObject *a2, GameObject *a3) { PlayerObject *m_player1; // r5 GameObject *m_anticheatSpike; // r3 bool *p_m_isPracticeMode; // r8 GameManager *v7; // r0 int v8; // r3 int v9; // r3 PlayerObject *OtherPlayer; // r5 int CurrentPercentInt; // r0 int m_isTestMode; // r5 int v13; // r5 _BOOL4 v14; // r6 _BOOL4 v15; // r3 bool m_showLeaderboardPercentage; // r7 double TempMilliTime; // r0 GameManager *v18; // r0 int v19; // r9 FMODAudioEngine *v20; // r0 FMODAudioEngine *v21; // r0 GameManager *v22; // r0 float *p_m_unkUint14; // r11 GameManager *v24; // r0 float v25; // s14 float v26; // r0 cocos2d::CCDelayTime *v27; // r0 cocos2d::CCSequence *v28; // r6 cocos2d::CCFiniteTimeAction *v29; // r0 cocos2d::CCAction *v30; // r1 PlayLayer *v31; // r0 GameStatsManager *v32; // r0 int v33; // r0 GJGameLevel *m_level; // r2 GameStatsManager *v35; // r0 int v36; // r0 float v37; // s16 GameManager *v38; // r0 GameManager *v39; // r0 GameStatsManager *v40; // r0 int v41; // r8 GameStatsManager *v42; // r0 bool v43; // r0 GameManager *v44; // r0 DialogObject *v45; // r0 DialogLayer *v46; // r5 cocos2d::CCDelayTime *v47; // r0 cocos2d::CCSequence *v48; // r5 cocos2d::CCFiniteTimeAction *v49; // r0 cocos2d::CCAction *v50; // r5 cocos2d::_ccColor3B v51; // [sp+8h] [bp-34h] FMODAudioEngine *v52; // [sp+14h] [bp-28h] _DWORD v53[2]; // [sp+24h] [bp-18h] BYREF _DWORD v54[2]; // [sp+2Ch] [bp-10h] BYREF if ( a2 ) m_player1 = a2; else m_player1 = a1->m_player1; if ( a1->m_player1->m_isLocked || a1->m_playerDied ) return; if ( a3 ) { m_anticheatSpike = a1->m_anticheatSpike; if ( m_anticheatSpike ) { if ( a3->m_uniqueID == m_anticheatSpike->m_uniqueID ) { a1->m_damageVerified = 1; return; } } } cocos2d::CCNode::stopActionByTag(a1, 20); p_m_isPracticeMode = &a1->m_isPracticeMode; ((void (__fastcall *)(PlayLayer *, int))a1->updateTimeWarp)(a1, 1065353216); PlayLayer::commitJumps(a1); GJEffectManager::playerDied(a1->m_effectManager); a1->m_gameState.m_pauseCounter = 0; if ( !a1->m_isPracticeMode ) { v7 = GameManager::sharedState(); if ( !GameManager::getGameVariable(v7, "0014") ) GJBaseGameLayer::shakeCamera(a1, 0.15, 1.0, 0.0); } a1->m_staticCameraShake = 1; if ( !a1->m_hintShown ) { v8 = a1->m_level->m_levelID.random - a1->m_level->m_levelID.seed; if ( (v8 == 1 || v8 == 1001) && !a1->m_player1->m_hasEverJumped && a1->m_attempts > 1 ) PlayLayer::showHint(a1); } if ( !a1->m_hintShown ) { v9 = a1->m_level->m_levelID.random - a1->m_level->m_levelID.seed; if ( (v9 == 3 || v9 == 1003) && !a1->m_player1->m_hasEverHitRing && a1->m_attempts > 1 ) PlayLayer::showHint(a1); } a1->m_playerDied = 1; if ( a1->m_hitboxesOnDeath && !((int (__fastcall *)(cocos2d::CCDrawNode *))a1->m_debugDrawNode->isVisible)(a1->m_debugDrawNode) ) { PlayLayer::toggleDebugDraw(a1); } PlayerObject::playerDestroyed(m_player1, 0); if ( a1->m_gameState.m_isDualMode ) { OtherPlayer = GJBaseGameLayer::getOtherPlayer(a1, m_player1); GJBaseGameLayer::playExitDualEffect(a1, OtherPlayer); PlayerObject::playerDestroyed(OtherPlayer, 1); } CurrentPercentInt = PlayLayer::getCurrentPercentInt(a1); m_isTestMode = a1->m_isTestMode; if ( a1->m_isTestMode ) { m_isTestMode = 0; goto LABEL_54; } if ( a1->m_isPlatformer ) { LABEL_54: v19 = m_isTestMode; m_showLeaderboardPercentage = m_isTestMode; v14 = m_isTestMode; goto LABEL_57; } v13 = CurrentPercentInt & ~(CurrentPercentInt >> 31); if ( v13 >= 99 ) v13 = 99; v14 = !*p_m_isPracticeMode && v13 > GJGameLevel::getNormalPercent(a1->m_level); v15 = !*p_m_isPracticeMode && v13 > a1->m_level->m_orbCompletion.random - a1->m_level->m_orbCompletion.seed; m_showLeaderboardPercentage = a1->m_showLeaderboardPercentage; if ( m_showLeaderboardPercentage ) { if ( *p_m_isPracticeMode || v14 ) { m_showLeaderboardPercentage = 0; } else { if ( !v15 ) v14 = v13 > a1->m_level->m_newNormalPercent2.random - a1->m_level->m_newNormalPercent2.seed; m_showLeaderboardPercentage = v14; } } TempMilliTime = PlayLayer::getTempMilliTime(a1); GJGameLevel::savePercentage( a1->m_level, v13, *p_m_isPracticeMode, a1->m_clicks, (int)(TempMilliTime - a1->m_currentTime - a1->m_pauseDelta), a1->m_damageVerified); if ( a1->m_level->m_levelType == Main ) { v18 = GameManager::sharedState(); GameManager::reportPercentageForLevel( v18, a1->m_level->m_levelID.random - a1->m_level->m_levelID.seed, v13, *p_m_isPracticeMode); } m_isTestMode = *p_m_isPracticeMode; if ( *p_m_isPracticeMode ) { m_isTestMode = 0; LABEL_56: v19 = m_isTestMode; goto LABEL_57; } if ( a1->m_level->m_stars.random - a1->m_level->m_stars.seed <= 0 || a1->m_isPlatformer ) goto LABEL_56; v32 = GameStatsManager::sharedState(); GameStatsManager::awardCurrencyForLevel(v32, a1->m_level); m_level = a1->m_level; v19 = v33; if ( m_level->m_dailyID.random - m_level->m_dailyID.seed > 0 || (m_isTestMode = m_level->m_gauntletLevel) != 0 ) { v35 = GameStatsManager::sharedState(); GameStatsManager::awardDiamondsForLevel(v35, a1->m_level); m_isTestMode = v36; } LABEL_57: if ( !*p_m_isPracticeMode ) a1->m_lastAttemptPercent = PlayLayer::getCurrentPercentInt(a1); if ( !a1->m_gameState.m_unkBool22 ) { if ( !*p_m_isPracticeMode || a1->m_practiceMusicSync ) { v20 = FMODAudioEngine::sharedEngine(); FMODAudioEngine::pauseAllMusic(v20, 0); } v21 = FMODAudioEngine::sharedEngine(); FMODAudioEngine::stopAllEffects(v21); } if ( !a1->m_gameState.m_unkBool26 ) { v52 = FMODAudioEngine::sharedEngine(); sub_776584((int)v54, "explode_11.ogg"); FMODAudioEngine::playEffect(v52, (int)v54, 1.0, 0, 1059481190); sub_774008(v54); } v22 = GameManager::sharedState(); p_m_unkUint14 = &a1->m_gameState.m_unkUint14; if ( !GameManager::getGameVariable(v22, "0026") && !*p_m_isPracticeMode ) { if ( v19 + m_isTestMode > 0 ) PlayLayer::showNewBest(a1, !v14, v19, m_isTestMode, 0, 0, 0); v24 = GameManager::sharedState(); UILayer::disableMenu(v24->m_playLayer->m_uiLayer); v25 = *p_m_unkUint14; shouldRefreshBanner = 0; if ( v25 > 0.5 ) v26 = v25; else v26 = 0.5; v27 = cocos2d::CCDelayTime::create(v26); v54[1] = 0; v54[0] = PlayLayer::showRetryLayer; v28 = (cocos2d::CCSequence *)v27; v29 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(a1, PlayLayer::showRetryLayer, 0); v30 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v28, v29, 0); v31 = a1; goto LABEL_74; } a1->m_inResetDelay = 1; v37 = 1.0; v38 = GameManager::sharedState(); if ( GameManager::getGameVariable(v38, "0052") ) v37 = 0.5; if ( *p_m_unkUint14 > v37 ) v37 = *p_m_unkUint14; if ( v14 || v19 + m_isTestMode > 0 ) { v39 = GameManager::sharedState(); if ( GameManager::getUGV(v39, "17") ) { v41 = 0; } else { v40 = GameStatsManager::sharedState(); v41 = GameStatsManager::getStat(v40, "14") > 500; } if ( !v14 && v19 + m_isTestMode <= 0 ) goto LABEL_93; v42 = GameStatsManager::sharedState(); v43 = GameStatsManager::awardSecretKey(v42); PlayLayer::showNewBest(a1, !v14, v19, m_isTestMode, v43, v41, m_showLeaderboardPercentage); if ( v37 < 1.4 ) v37 = 1.4; if ( v19 + m_isTestMode > 0 ) { if ( !v41 ) { cocos2d::CCNode::stopActionByTag(a1, 16); return; } } else { LABEL_93: if ( !v41 ) goto LABEL_96; } v44 = GameManager::sharedState(); GameManager::setUGV(v44, "17", 1); sub_776584((int)v53, "The Shopkeeper"); sub_776584((int)v54, "I see you have a lot of orbs. You should visit my shop!"); v45 = (DialogObject *)DialogObject::create( (DialogObject *)v53, (std::string)v54, (std::string)5, 1065353216, 0.0, 255, v51); v46 = DialogLayer::create(v45, (int)&dword_0 + 1); sub_774008(v54); sub_774008(v53); v41 = 1; a1->addChild_0(a1, v46, 100); v46->setOpacity(v46, 0); v46->m_delegate = &a1->DialogDelegate; DialogLayer::updateChatPlacement(v46, Top); DialogLayer::animateIn(v46, FromTop); } else { v41 = 0; } LABEL_96: cocos2d::CCNode::stopActionByTag(a1, 16); if ( !v41 ) { v47 = cocos2d::CCDelayTime::create(v37); v53[1] = 0; v53[0] = PlayLayer::delayedResetLevel; v48 = (cocos2d::CCSequence *)v47; v49 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(a1, PlayLayer::delayedResetLevel, 0); v50 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v48, v49, 0); v50->setTag(v50, 16); v31 = a1; v30 = v50; LABEL_74: cocos2d::CCNode::runAction(v31, v30); } }
GD Web Decomp Icon

GD Web Decomp

Raw Source