//
// SecretLayer2::getErrorMessage from 0x10030cd70 to 0x10030d0a4 (820 bytes)
//
// 1 xrefs:
// > SecretLayer2::onSubmit @ 0x10030b648
//
// 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 __usercall SecretLayer2::getErrorMessage(__int64 a1@, _QWORD *a2@)
{
int v4; // w8
int v5; // w8
char *v6; // x1
GameManager *v7; // x0
GameManager *v8; // x0
GameManager *v9; // x0
void **v10; // x8
cocos2d::CCString *v11; // x0
char *CString; // x0
void **v13; // x8
cocos2d::CCString *v14; // x0
char *v15; // x0
void **v16; // x8
cocos2d::CCString *v17; // x0
char *v18; // x0
void *__p[2]; // [xsp+10h] [xbp-30h] BYREF
char *longStorage; // [xsp+20h] [xbp-20h]
v4 = *(_DWORD *)(a1 + 452);
if ( v4 < 0 )
v5 = llroundf(vcvts_n_f32_s32(rand(), 0x1Fu) * 30.0);
else
v5 = v4 + 1;
if ( v5 > 29 )
v5 = 0;
*(_DWORD *)(a1 + 452) = v5;
switch ( v5 )
{
case 0:
v6 = "No, just no";
goto LABEL_41;
case 1:
v6 = "Swing and a miss!";
goto LABEL_41;
case 2:
v6 = "I told you, it wont work...";
goto LABEL_41;
case 3:
v6 = "Door is now open. Oh wait, no it's not.";
goto LABEL_41;
case 4:
v6 = "Is that actually your guess?";
goto LABEL_41;
case 5:
v7 = GameManager::sharedState();
if ( v7->m_playerName.m_data.m_short.shortStorage.__elems_[22] < 0 )
{
sub_1000097D0(__p, (void *)v7->m_playerName.m_data.m_long.capacitym1, v7->m_playerName.m_data.m_long.size);
}
else
{
*(_OWORD *)__p = *(_OWORD *)&v7->m_playerName.m_data.m_short.sizex2;
longStorage = v7->m_playerName.m_data.m_long.longStorage;
}
v10 = __p;
if ( SHIBYTE(longStorage) < 0 )
v10 = (void **)__p[0];
v11 = (cocos2d::CCString *)sub_100268F4C("Go home %s.", (const char *)v10);
CString = (char *)cocos2d::CCString::getCString(v11);
sub_100009900(a2, CString);
goto LABEL_54;
case 6:
v6 = "Nope";
goto LABEL_41;
case 7:
v6 = "Give up, please";
goto LABEL_41;
case 8:
v6 = "Door is still locked";
goto LABEL_41;
case 9:
v6 = "That tickles!";
goto LABEL_41;
case 10:
v6 = "Try harder please";
goto LABEL_41;
case 11:
v6 = "Don't make me angry";
goto LABEL_41;
case 12:
v6 = "You won't like me when im angry...";
goto LABEL_41;
case 13:
v6 = "Oh no, you just unlocked... NOTHING";
goto LABEL_41;
case 14:
v6 = "Only 3 attempts left!";
goto LABEL_41;
case 15:
v6 = "Only 2 attempts left!";
goto LABEL_41;
case 16:
v6 = "LAST ATTEMPT!";
goto LABEL_41;
case 17:
v6 = "Just kidding, unlimited attempts";
goto LABEL_41;
case 18:
v6 = "Maybe you should do something else?";
goto LABEL_41;
case 19:
v6 = "This is getting ridiculus...";
goto LABEL_41;
case 20:
v6 = "Go collect some stars";
goto LABEL_41;
case 21:
v6 = "How about no?";
goto LABEL_41;
case 22:
v8 = GameManager::sharedState();
if ( v8->m_playerName.m_data.m_short.shortStorage.__elems_[22] < 0 )
{
sub_1000097D0(__p, (void *)v8->m_playerName.m_data.m_long.capacitym1, v8->m_playerName.m_data.m_long.size);
}
else
{
*(_OWORD *)__p = *(_OWORD *)&v8->m_playerName.m_data.m_short.sizex2;
longStorage = v8->m_playerName.m_data.m_long.longStorage;
}
v13 = __p;
if ( SHIBYTE(longStorage) < 0 )
v13 = (void **)__p[0];
v14 = (cocos2d::CCString *)sub_100268F4C("%s, please give up...", (const char *)v13);
v15 = (char *)cocos2d::CCString::getCString(v14);
sub_100009900(a2, v15);
goto LABEL_54;
case 23:
v6 = "Error, error. Bad answers.";
goto LABEL_41;
case 24:
v6 = "Failure";
goto LABEL_41;
case 25:
v6 = "May I suggest thinking?";
goto LABEL_41;
case 26:
v6 = "WRONG";
goto LABEL_41;
case 27:
v6 = "You're hopeless...";
goto LABEL_41;
case 28:
v6 = "Really, still here?";
goto LABEL_41;
case 29:
v9 = GameManager::sharedState();
if ( v9->m_playerName.m_data.m_short.shortStorage.__elems_[22] < 0 )
{
sub_1000097D0(__p, (void *)v9->m_playerName.m_data.m_long.capacitym1, v9->m_playerName.m_data.m_long.size);
}
else
{
*(_OWORD *)__p = *(_OWORD *)&v9->m_playerName.m_data.m_short.sizex2;
longStorage = v9->m_playerName.m_data.m_long.longStorage;
}
v16 = __p;
if ( SHIBYTE(longStorage) < 0 )
v16 = (void **)__p[0];
v17 = (cocos2d::CCString *)sub_100268F4C("What kind of name is %s anyway?", (const char *)v16);
v18 = (char *)cocos2d::CCString::getCString(v17);
sub_100009900(a2, v18);
LABEL_54:
if ( SHIBYTE(longStorage) < 0 )
operator delete(__p[0]);
break;
default:
v6 = "Don't touch that!";
LABEL_41:
sub_100009900(a2, v6);
break;
}
}