//
// GJBaseGameLayer::activateItemEditTrigger from 0x9eca9c to 0x9ece00 (868 bytes)
//
// 2 xrefs:
// > ItemTriggerGameObject::triggerObject @ 0x899500
// > ??> @ 0x8bb10
//
// This function is hookable on this platform (idp: arm, 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:59:04 +0000
//
void __fastcall GJBaseGameLayer::activateItemEditTrigger(GJEffectManager **this, ItemTriggerGameObject *a2)
{
int v2; // w28
int v3; // w27
int v4; // w20
int v5; // w2
int v6; // w4
int v7; // w21
float v8; // s0
int v9; // w5
int v10; // w3
int v11; // w22
int v12; // w23
int v13; // w24
int v14; // w25
int v15; // w26
_BOOL4 v16; // w6
float v18; // s8
double v19; // d10
double v20; // d9
double v21; // d1
int v22; // w20
double ItemValue; // d10
int v24; // [xsp+80h] [xbp+80h]
int v25; // [xsp+88h] [xbp+88h]
int v26; // [xsp+88h] [xbp+88h]
_BOOL4 v27; // [xsp+90h] [xbp+90h]
int v28; // [xsp+90h] [xbp+90h]
double v29; // [xsp+90h] [xbp+90h]
v2 = *((_DWORD *)a2 + 466);
v3 = *((_DWORD *)a2 + 467);
v4 = *((_DWORD *)a2 + 462);
if ( v2 <= 0 )
v2 = 1;
v5 = *((_DWORD *)a2 + 420);
if ( v3 <= 2 )
v3 = 3;
v6 = *((_DWORD *)a2 + 417);
v7 = *((_DWORD *)a2 + 366);
v8 = roundf(*((float *)a2 + 463) * 1000.0);
v9 = *((_DWORD *)a2 + 460);
v10 = *((_DWORD *)a2 + 461);
v11 = *((_DWORD *)a2 + 465);
v12 = *((_DWORD *)a2 + 469);
v13 = *((_DWORD *)a2 + 470);
v14 = *((_DWORD *)a2 + 471);
v15 = *((_DWORD *)a2 + 472);
if ( v4 <= 0 )
{
v4 = 1;
}
else if ( v4 == 3 )
{
goto LABEL_9;
}
if ( v7 <= 0 )
return;
LABEL_9:
v16 = 0;
if ( v9 )
{
v16 = 1;
if ( v5 <= 0 )
v16 = (unsigned int)(v9 - 3) <= 1;
}
v18 = v8 / 1000.0;
if ( v10 && (v6 > 0 || (unsigned int)(v10 - 3) <= 1) )
{
v26 = *((_DWORD *)a2 + 461);
v28 = *((_DWORD *)a2 + 417);
if ( v16 )
{
ItemValue = GJBaseGameLayer::getItemValue(this, v9, v5);
v29 = GJBaseGameLayer::getItemValue(this, v26, v28);
v20 = GJBaseGameLayer::getItemValue(this, v4, v7);
v19 = GJBaseGameLayer::performMathOperation((GJBaseGameLayer *)this, ItemValue, v29, v2);
}
else
{
v19 = GJBaseGameLayer::getItemValue(this, v10, v6);
GJBaseGameLayer::getItemValue(this, v26, v28);
v20 = GJBaseGameLayer::getItemValue(this, v4, v7);
}
}
else
{
v27 = v16;
v24 = *((_DWORD *)a2 + 461);
v25 = *((_DWORD *)a2 + 417);
v19 = GJBaseGameLayer::getItemValue(this, v9, v5);
GJBaseGameLayer::getItemValue(this, v24, v25);
v20 = GJBaseGameLayer::getItemValue(this, v4, v7);
if ( !v27 )
{
v21 = v18;
if ( v12 )
goto LABEL_36;
LABEL_15:
if ( v14 )
goto LABEL_34;
LABEL_16:
if ( v11 )
goto LABEL_32;
LABEL_17:
if ( v13 )
goto LABEL_29;
LABEL_18:
if ( v15 )
goto LABEL_30;
goto LABEL_19;
}
}
v21 = GJBaseGameLayer::performMathOperation((GJBaseGameLayer *)this, v19, v18, v3);
if ( !v12 )
goto LABEL_15;
LABEL_36:
v21 = GJBaseGameLayer::performMathRounding((GJBaseGameLayer *)this, v21, v12);
if ( !v14 )
goto LABEL_16;
LABEL_34:
v21 = performMathSign(v21, v14);
if ( !v11 )
goto LABEL_17;
LABEL_32:
v21 = GJBaseGameLayer::performMathOperation((GJBaseGameLayer *)this, v20, v21, v11);
if ( !v13 )
goto LABEL_18;
LABEL_29:
v21 = GJBaseGameLayer::performMathRounding((GJBaseGameLayer *)this, v21, v13);
if ( v15 )
{
LABEL_30:
v21 = performMathSign(v21, v15);
if ( v4 == 2 )
goto LABEL_31;
goto LABEL_20;
}
LABEL_19:
if ( v4 == 2 )
{
LABEL_31:
GJEffectManager::updateTimer(*(this + 269), v7, v21);
return;
}
LABEL_20:
if ( v4 == 3 )
{
*((_BYTE *)this + 1920) = 1;
*((_DWORD *)this + 479) = (int)v21;
}
else if ( v4 == 1 )
{
v22 = (int)v21;
GJEffectManager::updateCountForItem(*(this + 269), v7, (int)v21);
GJBaseGameLayer::updateCounters((GJBaseGameLayer *)this, v7, v22);
}
}