//
// PlayLayer::showCompleteEffect from 0x403344 to 0x403626 (738 bytes)
//
// 1 xrefs:
// > PlayLayer::levelComplete @ 0x4082d0
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:47:25 +0000
//
void __fastcall PlayLayer::showCompleteEffect(unsigned __int8 **this, float a2)
{
PlayLayer *v2; // r4
unsigned __int8 *v3; // r6
int v4; // r5
int v5; // r3
int v6; // r6
FMODAudioEngine *v7; // r7
int v8; // r3
float v9; // s15
float v10; // r11
float v11; // s18
float v12; // s16
float v13; // s17
float v14; // s20
float v15; // s19
cocos2d::CCNode *v16; // r7
int v17; // r0
_BYTE *v18; // r3
char v19; // r8
cocos2d::CCSequence *v20; // r0
cocos2d::CCSequence *v21; // r5
cocos2d::CCFiniteTimeAction *v22; // r0
cocos2d::CCAction *v23; // r0
FMODAudioEngine *v24; // r0
FMODAudioEngine *v25; // r0
FMOD::Channel *ActiveMusicChannel; // r0
FMODAudioEngine *v27; // r0
int v28; // [sp+54h] [bp-38h]
float v29; // [sp+58h] [bp-34h] BYREF
float v30; // [sp+5Ch] [bp-30h]
_BYTE v31[8]; // [sp+60h] [bp-2Ch] BYREF
_BYTE v32[8]; // [sp+68h] [bp-24h] BYREF
_DWORD v33[2]; // [sp+70h] [bp-1Ch] BYREF
int v34[3]; // [sp+78h] [bp-14h] BYREF
v2 = (PlayLayer *)this;
v3 = *(this + 3074);
if ( !v3 )
{
v4 = 0;
goto LABEL_8;
}
v4 = v3[1648];
v5 = v3[1649];
v6 = v3[1650];
if ( v4 )
{
if ( v5 )
goto LABEL_10;
goto LABEL_8;
}
if ( !v5 )
{
LABEL_8:
memset(v34, 0, sizeof(v34));
v7 = (FMODAudioEngine *)FMODAudioEngine::sharedEngine((FMODAudioEngine *)this);
std::string::__init(v34, "endStart_02.ogg", 0xFu);
FMODAudioEngine::playEffect(v7, (int)v34);
v6 = 0;
this = (unsigned __int8 **)std::string::~string((int)v34);
goto LABEL_10;
}
v6 = 0;
LABEL_10:
v8 = *((_DWORD *)v2 + 2708);
if ( v8 )
{
v9 = 1.0;
if ( *(_BYTE *)(v8 + 1172) )
v9 = -1.0;
}
else
{
v9 = 1.0;
}
if ( *((_BYTE *)v2 + 10614) || *((_DWORD *)v2 + 3074) )
{
v13 = 0.5;
v10 = 180.0;
v12 = 0.0;
v14 = 16.0;
v11 = 0.0;
}
else
{
v10 = 45.0;
v11 = v9 * 30.0;
v12 = v9 * -90.0;
v13 = 1.0;
v14 = 8.0;
}
if ( !v4 )
{
cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)this);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v29);
v15 = sqrtf(
(float)((float)((float)(v30 / *((float *)v2 + 82)) * 0.5) * (float)((float)(v30 / *((float *)v2 + 82)) * 0.5))
+ (float)((float)(v29 / *((float *)v2 + 82)) * (float)(v29 / *((float *)v2 + 82))));
v16 = CCLightFlash::create((CCLightFlash *)LODWORD(v15));
(*(void (__fastcall **)(_DWORD, cocos2d::CCNode *, _DWORD))(**((_DWORD **)v2 + 609) + 232))(
*((_DWORD *)v2 + 609),
v16,
0);
v17 = (*(int (__fastcall **)(PlayLayer *))(*(_DWORD *)v2 + 256))(v2);
*((_DWORD *)v16 + 70) = 100;
*((_DWORD *)v16 + 69) = v17;
PlayLayer::getEndPosition((PlayLayer *)v31, (int)v2);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v32, v11, 0.0);
cocos2d::CCPoint::operator+(v33, v31, v32);
v18 = *((_BYTE **)v2 + 519);
BYTE1(v28) = v18[2107];
BYTE2(v28) = v18[2108];
LOBYTE(v28) = v18[2106];
CCLightFlash::playEffect(
(int)v16,
(int)v33,
v28,
1.0,
0.0,
30.0,
20.0,
(float)(v15 + v11) + 10.0,
v13 * 0.18,
v13 * 0.04,
v13 * 0.195,
v13 * 0.04,
v13 * 0.04,
v12,
v10,
155.0,
100.0,
(int)v14,
1,
0,
0.4);
v19 = *((_BYTE *)v2 + 10865);
*((_BYTE *)v2 + 10865) = 0;
GJBaseGameLayer::shakeCamera(v2, (float)((float)(v14 + 2.0) * 0.195) * v13, 3.0, 0.0);
*((_BYTE *)v2 + 10865) = v19;
}
if ( v6 )
{
v24 = (FMODAudioEngine *)PlayLayer::showCompleteText(v2);
}
else
{
v20 = (cocos2d::CCSequence *)cocos2d::CCDelayTime::create(
COERCE_COCOS2D_CCDELAYTIME_((float)((float)(v14 + 2.0) * 0.195) * v13),
a2);
v33[1] = 0;
v33[0] = PlayLayer::showCompleteText;
v21 = v20;
v22 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(v2, PlayLayer::showCompleteText, 0);
v23 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v21, v22, 0);
v24 = (FMODAudioEngine *)cocos2d::CCNode::runAction(v2, v23);
}
v25 = (FMODAudioEngine *)FMODAudioEngine::sharedEngine(v24);
ActiveMusicChannel = (FMOD::Channel *)FMODAudioEngine::getActiveMusicChannel(v25, 0);
if ( ActiveMusicChannel )
ActiveMusicChannel = (FMOD::Channel *)FMOD::Channel::setLoopCount(ActiveMusicChannel, 0);
if ( *(_BYTE *)(*((_DWORD *)v2 + 521) + 289)
|| *(_DWORD *)(*((_DWORD *)v2 + 352) + 268) - 3001 == *(_DWORD *)(*((_DWORD *)v2 + 352) + 272) )
{
v27 = (FMODAudioEngine *)FMODAudioEngine::sharedEngine(ActiveMusicChannel);
FMODAudioEngine::fadeOutMusic(v27, 2.0, 0);
}
}