//
// GJBaseGameLayer::hasUniqueCoin from 0x85a6c0 to 0x85a7d8 (280 bytes)
//
// 5 xrefs:
// > EnhancedGameObject::updateUserCoin @ 0x65276c
// > GJBaseGameLayer::collisionCheckObjects @ 0x88bed0
// > GJBaseGameLayer::collisionCheckObjects @ 0x88c184
// > GameObject::playDestroyObjectAnim @ 0x9b3150
// > ??> @ 0xad670
//
// 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
//
bool GJBaseGameLayer::hasUniqueCoin(GJBaseGameLayer *a1, EffectGameObject *a2)
{
GJGameLevel *m_level; // x0
const char *CoinKey; // x20
GameStatsManager *v5; // x0
bool result; // w0
bool v7; // zf
int m_secretCoinID; // w1
GameStatsManager *v9; // x0
GameStatsManager *v10; // x0
m_level = a1->m_level;
if ( m_level->m_levelType == Editor )
{
v7 = a2->getType(a2) == (Collectible|0x1);
result = 0;
if ( v7 )
{
m_secretCoinID = a2->m_secretCoinID;
switch ( m_secretCoinID )
{
case 1:
return a1->m_level->m_firstCoinVerified.random - a1->m_level->m_firstCoinVerified.seed == 1;
case 2:
return a1->m_level->m_secondCoinVerified.random - a1->m_level->m_secondCoinVerified.seed == 1;
case 3:
return a1->m_level->m_thirdCoinVerified.random - a1->m_level->m_thirdCoinVerified.seed == 1;
}
}
}
else
{
CoinKey = GJGameLevel::getCoinKey(m_level, a2->m_secretCoinID);
if ( a1->m_level->m_levelType == Main )
{
v10 = GameStatsManager::sharedState();
return GameStatsManager::hasSecretCoin(v10, CoinKey);
}
else
{
v5 = GameStatsManager::sharedState();
result = GameStatsManager::hasUserCoin(v5, CoinKey);
if ( !result )
{
v9 = GameStatsManager::sharedState();
return GameStatsManager::hasPendingUserCoin(v9, CoinKey);
}
}
}
return result;
}