//
// CountTriggerGameObject::triggerObject from 0x1001d6b80 to 0x1001d6dca (586 bytes)
//
// 1 xrefs:
// > ??> @ 0x1008d17a0
//
// 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 CountTriggerGameObject::triggerObject(
CountTriggerGameObject *a1,
GJBaseGameLayer *a2,
int a3,
std::vector *const a4)
{
int m_objectID; // eax
GJEffectManager *m_effectManager; // r10
int v6; // esi
int v7; // edx
bool m_multiActivate; // r14
int v9; // r8d
bool v10; // r15
std::__vector_base::pointer v11; // r13
signed __int64 v12; // rbx
int m_itemID; // r9d
int m_pickupCount; // edx
int m_targetGroupID; // r10d
bool m_activateGroup; // r14
int m_pickupTriggerMode; // r12d
std::__vector_base::pointer begin; // r13
signed __int64 v19; // rbx
GJEffectManager *v20; // [rsp+28h] [rbp-58h]
int v21; // [rsp+34h] [rbp-4Ch]
int v22; // [rsp+38h] [rbp-48h]
int v23; // [rsp+38h] [rbp-48h]
int v24; // [rsp+3Ch] [rbp-44h]
int v25; // [rsp+3Ch] [rbp-44h]
std::vector __p[2]; // [rsp+40h] [rbp-40h] BYREF
m_objectID = a1->m_objectID;
if ( m_objectID == 1817 )
{
GJBaseGameLayer::addPickupTrigger(a2, a1);
return;
}
if ( m_objectID == 1811 )
{
m_itemID = a1->m_itemID;
m_pickupCount = a1->m_pickupCount;
m_targetGroupID = a1->m_targetGroupID;
m_activateGroup = a1->m_activateGroup;
m_pickupTriggerMode = a1->m_pickupTriggerMode;
if ( a4 )
{
memset(__p, 0, 24);
begin = a4->__begin_;
v19 = (char *)a4->__end_ - (char *)a4->__begin_;
if ( v19 )
{
v25 = m_targetGroupID;
v23 = m_pickupCount;
v21 = m_itemID;
if ( v19 < 0 )
goto LABEL_21;
__p[0].__begin_ = (std::__vector_base::pointer)operator new(v19);
__p[0].__end_cap_.__value_ = (std::__vector_base::pointer)((char *)__p[0].__begin_ + v19);
memcpy(__p[0].__begin_, begin, v19);
__p[0].__end_ = (std::__vector_base::pointer)((char *)__p[0].__begin_ + v19);
m_itemID = v21;
m_pickupCount = v23;
m_targetGroupID = v25;
}
}
else
{
memset(__p, 0, 24);
}
GJBaseGameLayer::testInstantCountTrigger(
a2,
m_itemID,
m_pickupCount,
m_targetGroupID,
m_activateGroup,
m_pickupTriggerMode,
__p,
a1->m_uniqueID,
a1->m_controlID);
goto LABEL_18;
}
if ( m_objectID != 1611 )
{
EffectGameObject::triggerObject(a1, a2, a3, a4);
return;
}
m_effectManager = a2->m_effectManager;
v6 = a1->m_itemID;
v7 = a1->m_pickupCount;
m_multiActivate = a1->m_multiActivate;
v9 = a1->m_targetGroupID;
v10 = a1->m_activateGroup;
if ( !a4 )
{
memset(__p, 0, 24);
goto LABEL_17;
}
memset(__p, 0, 24);
v11 = a4->__begin_;
v12 = (char *)a4->__end_ - (char *)a4->__begin_;
if ( v12 )
{
v24 = v9;
v22 = v7;
v20 = m_effectManager;
if ( v12 >= 0 )
{
__p[0].__begin_ = (std::__vector_base::pointer)operator new(v12);
__p[0].__end_cap_.__value_ = (std::__vector_base::pointer)((char *)__p[0].__begin_ + v12);
memcpy(__p[0].__begin_, v11, v12);
__p[0].__end_ = (std::__vector_base::pointer)((char *)__p[0].__begin_ + v12);
m_effectManager = v20;
v7 = v22;
v9 = v24;
goto LABEL_17;
}
LABEL_21:
sub_1000C40D0();
}
LABEL_17:
GJEffectManager::runCountTrigger(
m_effectManager,
v6,
v7,
m_multiActivate,
v9,
v10,
__p,
a1->m_uniqueID,
a1->m_controlID);
LABEL_18:
if ( __p[0].__begin_ )
{
__p[0].__end_ = __p[0].__begin_;
operator delete(__p[0].__begin_);
}
}