//
// MapSelectLayer::checkTouchMonster from 0x1002532f0 to 0x1002537ac (1212 bytes)
//
// 1 xrefs:
// > MapSelectLayer::ccTouchBegan @ 0x100253844
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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 12:27:25 +0000
//
char __fastcall MapSelectLayer::checkTouchMonster(__int64 a1, __int64 a2)
{
__int64 v2; // r14
unsigned int v3; // r15d
__int64 v4; // rbx
__int64 v5; // r12
double v6; // xmm0_8
__int64 v7; // rax
__int64 v8; // r12
int v9; // eax
__int64 v10; // r13
__int64 v11; // r12
__int64 v12; // r13
__int64 v13; // rax
__int64 v14; // r15
_DWORD *v15; // r13
int v16; // eax
__m128 v17; // xmm0
__m128 v18; // xmm1
__m128 v19; // xmm0
__m128 v20; // xmm1
__int64 v21; // r8
__int64 v22; // r9
__int64 v23; // rax
_BYTE v25[8]; // [rsp+18h] [rbp-88h] BYREF
__m128d v26; // [rsp+20h] [rbp-80h]
_BYTE v27[8]; // [rsp+30h] [rbp-70h] BYREF
__int64 v28; // [rsp+38h] [rbp-68h]
char v29; // [rsp+40h] [rbp-60h] BYREF
char v30[15]; // [rsp+41h] [rbp-5Fh] BYREF
void *__p; // [rsp+50h] [rbp-50h]
__int128 v32; // [rsp+58h] [rbp-48h] BYREF
__int64 v33; // [rsp+68h] [rbp-38h]
unsigned int v34; // [rsp+70h] [rbp-30h]
float v35; // [rsp+74h] [rbp-2Ch]
v28 = a2;
v2 = a1;
v3 = 0;
if ( (unsigned int)sub_1007FEF90(*(_QWORD *)(a1 + 472)) )
{
v26 = _mm_unpacklo_pd((__m128d)0x3F800000u, (__m128d)xmmword_100A03610);
v35 = 0.0;
v33 = a1;
while ( 1 )
{
v4 = sub_1007FEFE0(*(_QWORD *)(v2 + 472), v3);
v5 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v4 + 192LL))(v4);
HIDWORD(v6) = 0;
sub_100278250(&v32, 0.0, 5.0);
sub_100278350(v27, v5, &v32);
*(float *)&v6 = cocos2d::ccpDistance(v28, v27);
if ( *(float *)&v6 >= 20.0 )
{
++v3;
}
else
{
v34 = v3;
v7 = GJMapObject::touchMonster(v4);
if ( *(int *)(v4 + 368) >= 10 )
{
v8 = FMODAudioEngine::sharedEngine(v6);
v29 = 28;
strcpy(v30, "explode_11.ogg");
v9 = rand();
v2 = v33;
FMODAudioEngine::playEffect(
v8,
&v29,
(float)((float)((float)((float)((float)v9 * 4.6566129e-10) + (float)((float)v9 * 4.6566129e-10)) + -1.0)
* 0.050000001)
+ 0.94999999,
0.0,
0.5);
if ( (v29 & 1) != 0 )
operator delete(__p);
v10 = cocos2d::CCParticleSystemQuad::create("explodeEffect.plist", 0);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v10 + 1568LL))(v10, 2);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(v2 + 424) + 464LL))(
*(_QWORD *)(v2 + 424),
v10,
1);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v10 + 1584LL))(v10, 1);
(*(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v10 + 184LL))(v10, v27);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v10 + 160LL))(v10, 0.30000001);
v32 = (__int128)v26;
(*(void (__fastcall **)(__int64, __int128 *))(*(_QWORD *)v10 + 1360LL))(v10, &v32);
cocos2d::CCParticleSystem::resetSystem(v10);
v11 = CCCircleWave::create_1(0, 10.0, 40.0, 0.40000001);
*(_BYTE *)(v11 + 342) = 0;
*(_WORD *)(v11 + 340) = 255;
(*(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v11 + 184LL))(v11, v27);
(*(void (__fastcall **)(_QWORD, __int64, _QWORD))(**(_QWORD **)(v2 + 424) + 464LL))(
*(_QWORD *)(v2 + 424),
v11,
0);
v12 = cocos2d::CCRenderTexture::create_2(50, 50);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(v4 + 336) + 344LL))(*(_QWORD *)(v4 + 336), 0);
v13 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v4 + 192LL))(v4);
v14 = v4;
sub_1002782D0(v25, v13);
sub_100278250(&v32, 25.0, 25.0);
(*(void (__fastcall **)(__int64, __int128 *))(*(_QWORD *)v14 + 184LL))(v14, &v32);
cocos2d::CCRenderTexture::beginWithClear_3(v12, 0.0, 0.0, 0.0, 0.0);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v14 + 752LL))(v14);
cocos2d::CCRenderTexture::end(v12);
(*(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v14 + 184LL))(v14, v25);
v15 = ExplodeItemNode::create(v12);
v15[85] = -1027080192;
(*(void (__fastcall **)(_QWORD, _DWORD *, __int64))(**(_QWORD **)(v2 + 424) + 464LL))(
*(_QWORD *)(v2 + 424),
v15,
101);
(*(void (__fastcall **)(_DWORD *, _BYTE *))(*(_QWORD *)v15 + 184LL))(v15, v25);
v16 = rand();
v35 = (float)((float)((float)((float)v16 * 4.6566129e-10) + (float)((float)v16 * 4.6566129e-10)) + -1.0) * 3.0;
v17 = 0;
v17.f32[0] = (float)((float)rand() * 4.6566129e-10) * 4.0;
v18 = _mm_or_ps(_mm_and_ps(v17, (__m128)xmmword_100A035F0), (__m128)xmmword_100A03600);
v18.f32[0] = v18.f32[0] + v17.f32[0];
LODWORD(v11) = (int)(float)(_mm_round_ss((__m128)0LL, v18, 11).f32[0] + 4.0);
v19 = 0;
v19.f32[0] = (float)((float)rand() * 4.6566129e-10) * 4.0;
v20 = _mm_or_ps(_mm_and_ps(v19, (__m128)xmmword_100A035F0), (__m128)xmmword_100A03600);
v20.f32[0] = v20.f32[0] + v19.f32[0];
v32 = xmmword_100A03F70;
ExplodeItemNode::createSprites(
(__int64)v15,
v11,
(int)(float)(_mm_round_ss((__m128)0LL, v20, 11).f32[0] + 4.0),
1,
v35 * 0.5,
v35,
4.0,
2.0,
6.4000001,
0.0,
(__m128)xmmword_100A038B0,
(__m128)xmmword_100A038B0,
v21,
v22,
0);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v14 + 528LL))(v14, 1);
v3 = v34;
v23 = sub_1007FF150(*(_QWORD *)(v2 + 472), v34, 1);
LOBYTE(v23) = 1;
v35 = *(float *)&v23;
goto LABEL_5;
}
v3 = v34 + 1;
LOBYTE(v7) = 1;
v35 = *(float *)&v7;
}
v2 = v33;
LABEL_5:
if ( v3 >= (unsigned int)sub_1007FEF90(*(_QWORD *)(v2 + 472)) )
return LOBYTE(v35) & 1;
}
}
v35 = 0.0;
return LOBYTE(v35) & 1;
}