//
// SequenceTriggerGameObject::customObjectSetup from 0x10038a534 to 0x10038a84c (792 bytes)
//
// 1 xrefs:
// > ??> @ 0x1008007e8
//
// 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 SequenceTriggerGameObject::customObjectSetup(
SequenceTriggerGameObject *a1,
std::vector *a2,
std::vector *a3)
{
std::__vector_base::pointer begin; // x21
std::__vector_base::pointer capacitym1; // x0
float v8; // s0
std::__vector_base::pointer v9; // x0
int v10; // w0
std::__vector_base::pointer v11; // x0
int v12; // w0
std::__vector_base::pointer v13; // x0
float v14; // s0
void *v15; // x8
std::__vector_base::pointer v16; // x0
std::__vector_base::pointer v17; // x8
cocos2d::CCArray *v18; // x20
unsigned int v19; // w22
std::vector *p_m_chanceObjects; // x21
cocos2d::CCString *v21; // x0
int v22; // w23
unsigned int v23; // w22
cocos2d::CCString *v24; // x0
unsigned int v25; // w0
unsigned int v26; // w24
std::__vector_base::pointer end; // x8
ChanceObject *value; // x9
ChanceObject *v29; // x27
std::__vector_base::pointer v30; // x1
signed __int64 v31; // x2
__int64 v32; // x27
unsigned __int64 v33; // x8
__int64 v34; // x9
char *v35; // x0
unsigned __int64 v36; // x1
ChanceObject *v37; // x10
ChanceObject *v38; // x28
ChanceObject *v39; // x23
std::__vector_base::pointer v40; // x0
std::__vector_base::pointer v41; // x8
std::__vector_base::pointer v42; // x9
int v43; // w10
std::string __p; // [xsp+0h] [xbp-70h] BYREF
EffectGameObject::customObjectSetup(a1, a2, a3);
begin = a3->__begin_;
if ( begin[437] )
{
capacitym1 = a2->__begin_ + 437;
if ( a2->__begin_[437].m_data.m_short.shortStorage.__elems_[22] < 0 )
capacitym1 = (std::__vector_base::pointer)capacitym1->m_data.m_long.capacitym1;
v8 = atof((const char *)capacitym1);
}
else
{
v8 = 0.0;
}
a1->m_minInt = v8;
if ( begin[436] )
{
v9 = a2->__begin_ + 436;
if ( a2->__begin_[436].m_data.m_short.shortStorage.__elems_[22] < 0 )
v9 = (std::__vector_base::pointer)v9->m_data.m_long.capacitym1;
v10 = atoi((const char *)v9);
}
else
{
v10 = 0;
}
a1->m_sequenceMode = v10;
if ( begin[439] )
{
v11 = a2->__begin_ + 439;
if ( a2->__begin_[439].m_data.m_short.shortStorage.__elems_[22] < 0 )
v11 = (std::__vector_base::pointer)v11->m_data.m_long.capacitym1;
v12 = atoi((const char *)v11);
}
else
{
v12 = 0;
}
a1->m_resetMode = v12;
if ( begin[438] )
{
v13 = a2->__begin_ + 438;
if ( a2->__begin_[438].m_data.m_short.shortStorage.__elems_[22] < 0 )
v13 = (std::__vector_base::pointer)v13->m_data.m_long.capacitym1;
v14 = atof((const char *)v13);
}
else
{
v14 = 0.0;
}
a1->m_reset = v14;
v15 = begin[505];
if ( v15 )
{
v16 = a2->__begin_ + 505;
if ( a2->__begin_[505].m_data.m_short.shortStorage.__elems_[22] < 0 )
v16 = (std::__vector_base::pointer)v16->m_data.m_long.capacitym1;
LOBYTE(v15) = atoi((const char *)v16) != 0;
}
a1->m_uniqueRemap = (char)v15;
if ( begin[435] )
{
v17 = a2->__begin_;
if ( a2->__begin_[435].m_data.m_short.shortStorage.__elems_[22] < 0 )
sub_1000097D0(&__p, (void *)v17[435].m_data.m_long.capacitym1, v17[435].m_data.m_long.size);
else
__p = v17[435];
}
else
{
sub_100009900(&__p, "");
}
v18 = (cocos2d::CCArray *)sub_100389CF4((const std::string *)&__p);
v19 = 0;
p_m_chanceObjects = &a1->m_chanceObjects;
while ( v19 < (unsigned int)sub_10024A36C((__int64)v18) )
{
v21 = cocos2d::CCArray::stringAtIndex(v18, v19);
v22 = cocos2d::CCString::intValue(v21);
v23 = v19 + 1;
v24 = cocos2d::CCArray::stringAtIndex(v18, v23);
v25 = cocos2d::CCString::intValue(v24);
v26 = v25;
end = a1->m_chanceObjects.__end_;
value = a1->m_chanceObjects.__end_cap_.__value_;
if ( end >= value )
{
v30 = p_m_chanceObjects->__begin_;
v31 = (char *)end - (char *)p_m_chanceObjects->__begin_;
v32 = v31 >> 4;
v33 = (v31 >> 4) + 1;
if ( v33 >> 60 )
sub_10000A5F8();
v34 = (char *)value - (char *)v30;
if ( v34 >> 3 > v33 )
v33 = v34 >> 3;
if ( (unsigned __int64)v34 >= 0x7FFFFFFFFFFFFFF0LL )
v33 = 0xFFFFFFFFFFFFFFFLL;
if ( v33 )
{
v35 = (char *)sub_10002F8CC((__int64)&a1->m_chanceObjects, v33);
v33 = v36;
v30 = a1->m_chanceObjects.__begin_;
v31 = (char *)a1->m_chanceObjects.__end_ - (char *)v30;
}
else
{
v35 = nullptr;
}
v37 = (ChanceObject *)&v35[16 * v32];
v38 = (ChanceObject *)&v35[16 * v33];
v37->m_groupID = v22;
v37->m_oldGroupID = v22;
v37->m_chance = v26;
v37->m_unk00c = 0;
v29 = v37 + 1;
v39 = &v37[-(v31 >> 4)];
memcpy(v39, v30, v31);
v40 = a1->m_chanceObjects.__begin_;
a1->m_chanceObjects.__begin_ = v39;
a1->m_chanceObjects.__end_ = v29;
a1->m_chanceObjects.__end_cap_.__value_ = v38;
if ( v40 )
operator delete(v40);
}
else
{
end->m_groupID = v22;
end->m_oldGroupID = v22;
v29 = end + 1;
*(_QWORD *)&end->m_chance = v25;
}
a1->m_chanceObjects.__end_ = v29;
v19 = v23 + 1;
}
a1->m_sequenceTotalCount = 0;
v41 = a1->m_chanceObjects.__begin_;
v42 = a1->m_chanceObjects.__end_;
if ( v41 != v42 )
{
v43 = 0;
do
{
v43 += v41->m_chance;
++v41;
}
while ( v41 != v42 );
a1->m_sequenceTotalCount = v43;
}
if ( __p.m_data.m_short.shortStorage.__elems_[22] < 0 )
operator delete((void *)__p.m_data.m_long.capacitym1);
}