//
// GJBaseGameLayer::updateActiveEnterEffect from 0x10011e090 to 0x10011e524 (1172 bytes)
//
// 1 xrefs:
// > EffectGameObject::triggerObject @ 0x1001b969e
//
// 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 __fastcall GJBaseGameLayer::updateActiveEnterEffect(GJBaseGameLayer *a1, EnterEffectObject *a2)
{
int m_objectID; // eax
int v3; // ebx
unsigned int m_enterType; // ecx
unsigned int v5; // ecx
int *p_m_enterType; // r15
char v7; // al
unsigned __int64 m_enterChannel; // r9
unsigned __int64 value; // r10
unsigned __int64 v10; // rdx
__int64 v11; // rcx
std::__hash_node_base>, void *> *> *v12; // rax
std::__hash_node_base>, void *> *>::__next_pointer next; // r8
unsigned __int64 v14; // r10
std::__hash_node_base>, void *> *>::__next_pointer v15; // rax
unsigned __int64 v16; // rcx
unsigned __int64 v17; // r8
std::unordered_map> *p_m_exitEffectInstanceVectors; // rdi
unsigned __int64 v19; // rdx
__int64 v20; // rbx
unsigned __int64 v21; // rax
std::__hash_node_base>, void *> *> *v22; // rax
std::__hash_node_base>, void *> *>::__next_pointer v23; // rsi
unsigned __int64 v24; // r8
unsigned __int64 v25; // rax
std::__hash_node_base>, void *> *>::__next_pointer v26; // rax
m_objectID = a2->m_objectID;
v3 = -2;
switch ( m_objectID )
{
case 23:
v3 = -6;
m_enterType = a2->m_enterType;
if ( m_enterType < 2 )
goto LABEL_31;
goto LABEL_13;
case 24:
v3 = -5;
m_enterType = a2->m_enterType;
if ( m_enterType >= 2 )
goto LABEL_13;
goto LABEL_31;
case 25:
v3 = -7;
m_enterType = a2->m_enterType;
if ( m_enterType >= 2 )
goto LABEL_13;
goto LABEL_31;
case 26:
v3 = -8;
m_enterType = a2->m_enterType;
if ( m_enterType >= 2 )
goto LABEL_13;
goto LABEL_31;
case 27:
v3 = -3;
m_enterType = a2->m_enterType;
if ( m_enterType >= 2 )
goto LABEL_13;
goto LABEL_31;
case 28:
v3 = -4;
m_enterType = a2->m_enterType;
if ( m_enterType >= 2 )
goto LABEL_13;
goto LABEL_31;
case 29:
case 30:
case 31:
case 32:
case 33:
case 34:
case 35:
case 36:
case 37:
case 38:
case 39:
case 40:
case 41:
case 42:
case 43:
case 44:
case 45:
case 46:
case 47:
case 48:
case 49:
case 50:
case 51:
case 52:
case 53:
case 54:
goto LABEL_30;
case 55:
v3 = -11;
goto LABEL_30;
case 56:
v3 = -10;
m_enterType = a2->m_enterType;
if ( m_enterType >= 2 )
goto LABEL_13;
goto LABEL_31;
case 57:
v3 = -9;
m_enterType = a2->m_enterType;
if ( m_enterType >= 2 )
goto LABEL_13;
goto LABEL_31;
case 58:
v3 = -12;
m_enterType = a2->m_enterType;
if ( m_enterType >= 2 )
goto LABEL_13;
goto LABEL_31;
case 59:
v3 = -13;
m_enterType = a2->m_enterType;
if ( m_enterType >= 2 )
goto LABEL_13;
goto LABEL_31;
default:
if ( (unsigned int)(m_objectID - 3017) < 5 )
{
v5 = a2->m_enterType;
if ( v5 > 1 )
{
v7 = 1;
v3 = -15;
if ( (v5 & 0xFFFFFFFD) != 0 )
return;
goto LABEL_47;
}
p_m_enterType = &a2->m_enterType;
a1->m_gameState.m_enterChannelMap.__begin_[a2->m_enterChannel] = -15;
GJBaseGameLayer::addCustomEnterEffect(a1, a2, 1);
v7 = 1;
v3 = -15;
goto LABEL_46;
}
if ( m_objectID == 1915 )
{
v3 = -14;
m_enterType = a2->m_enterType;
if ( m_enterType >= 2 )
{
LABEL_13:
v7 = 0;
if ( (m_enterType & 0xFFFFFFFD) != 0 )
return;
goto LABEL_47;
}
}
else
{
LABEL_30:
m_enterType = a2->m_enterType;
if ( m_enterType >= 2 )
goto LABEL_13;
}
LABEL_31:
p_m_enterType = &a2->m_enterType;
a1->m_gameState.m_enterChannelMap.__begin_[a2->m_enterChannel] = v3;
m_enterChannel = (unsigned int)a2->m_enterChannel;
if ( m_enterChannel > 0x64 )
goto LABEL_45;
value = a1->m_gameState.m_enterEffectInstanceVectors.__table_.__bucket_list_.__ptr_.__value_.__data_.__value_;
if ( !value )
goto LABEL_45;
v10 = (0x101010101010101LL
* ((((value - ((value >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)
+ (((value - ((value >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)
+ ((((value - ((value >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)
+ (((value - ((value >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)) >> 4))
& 0xF0F0F0F0F0F0F0FLL)) >> 56;
if ( v10 > 1 )
{
v11 = (unsigned int)a2->m_enterChannel;
if ( value <= m_enterChannel )
v11 = (unsigned __int8)((unsigned __int8)m_enterChannel % (unsigned __int8)value);
}
else
{
v11 = ((_DWORD)value + 127) & (unsigned int)m_enterChannel;
}
v12 = a1->m_gameState.m_enterEffectInstanceVectors.__table_.__bucket_list_.__ptr_.__value_[v11];
if ( !v12 || (next = v12->__next_) == nullptr )
{
LABEL_45:
v7 = 0;
goto LABEL_46;
}
if ( (unsigned int)v10 < 2 )
{
v14 = value - 1;
while ( 1 )
{
v15 = next[1].__next_;
if ( v15 == (std::__hash_node_base>, void *> *>::__next_pointer)m_enterChannel )
{
if ( LODWORD(next[2].__next_) == (_DWORD)m_enterChannel )
goto LABEL_85;
}
else if ( (v14 & (unsigned __int64)v15) != v11 )
{
goto LABEL_45;
}
next = next->__next_;
v7 = 0;
if ( !next )
goto LABEL_46;
}
}
break;
}
while ( 1 )
{
v21 = (unsigned __int64)next[1].__next_;
if ( v21 == m_enterChannel )
break;
if ( v21 >= value )
{
if ( (value | v21) >> 32 )
v21 %= value;
else
v21 = (unsigned int)v21 % (unsigned int)value;
}
if ( v21 != v11 )
goto LABEL_45;
LABEL_55:
next = next->__next_;
v7 = 0;
if ( !next )
goto LABEL_46;
}
if ( LODWORD(next[2].__next_) != (_DWORD)m_enterChannel )
goto LABEL_55;
LABEL_85:
sub_100167AA0(&a1->m_gameState.m_enterEffectInstanceVectors, next);
v7 = 0;
LABEL_46:
if ( (*p_m_enterType & 0xFFFFFFFD) != 0 )
return;
LABEL_47:
a1->m_gameState.m_exitChannelMap.__begin_[a2->m_enterChannel] = v3;
if ( v7 )
{
GJBaseGameLayer::addCustomEnterEffect(a1, a2, 0);
return;
}
v16 = (unsigned int)a2->m_enterChannel;
if ( v16 <= 0x64 )
{
v17 = a1->m_gameState.m_exitEffectInstanceVectors.__table_.__bucket_list_.__ptr_.__value_.__data_.__value_;
if ( v17 )
{
p_m_exitEffectInstanceVectors = &a1->m_gameState.m_exitEffectInstanceVectors;
v19 = (0x101010101010101LL
* ((((v17 - ((v17 >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)
+ (((v17 - ((v17 >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)
+ ((((v17 - ((v17 >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)
+ (((v17 - ((v17 >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)) >> 4))
& 0xF0F0F0F0F0F0F0FLL)) >> 56;
if ( v19 > 1 )
{
v20 = (unsigned int)a2->m_enterChannel;
if ( v17 <= v16 )
v20 = (unsigned __int8)((unsigned __int8)v16 % (unsigned __int8)v17);
}
else
{
v20 = ((_DWORD)v17 + 127) & (unsigned int)v16;
}
v22 = p_m_exitEffectInstanceVectors->__table_.__bucket_list_.__ptr_.__value_[v20];
if ( v22 )
{
v23 = v22->__next_;
if ( v22->__next_ )
{
if ( (unsigned int)v19 < 2 )
{
v24 = v17 - 1;
while ( 1 )
{
v26 = v23[1].__next_;
if ( v26 == (std::__hash_node_base>, void *> *>::__next_pointer)v16 )
{
if ( LODWORD(v23[2].__next_) == (_DWORD)v16 )
goto LABEL_86;
}
else if ( (v24 & (unsigned __int64)v26) != v20 )
{
return;
}
v23 = v23->__next_;
if ( !v23 )
return;
}
}
do
{
v25 = (unsigned __int64)v23[1].__next_;
if ( v25 == v16 )
{
if ( LODWORD(v23[2].__next_) == (_DWORD)v16 )
{
LABEL_86:
sub_100167AA0(p_m_exitEffectInstanceVectors, v23);
return;
}
}
else
{
if ( v25 < v17 )
goto LABEL_76;
if ( (v17 | v25) >> 32 )
{
v25 %= v17;
LABEL_76:
if ( v25 != v20 )
return;
goto LABEL_71;
}
if ( (unsigned int)v25 % (unsigned int)v17 != v20 )
return;
}
LABEL_71:
v23 = v23->__next_;
}
while ( v23 );
}
}
}
}
}